Implement Clownfish::Obj->to_perl directly

Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/1182c0dc
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/1182c0dc
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/1182c0dc

Branch: refs/heads/master
Commit: 1182c0dc767fe2deb8b0767cc791ee545ad6b0bf
Parents: 51866b6
Author: Nick Wellnhofer <wellnho...@aevum.de>
Authored: Sun Nov 15 16:15:08 2015 +0100
Committer: Nick Wellnhofer <wellnho...@aevum.de>
Committed: Tue Nov 17 18:27:56 2015 +0100

----------------------------------------------------------------------
 runtime/perl/buildlib/Clownfish/Build/Binding.pm | 17 +++++++++++++++++
 runtime/perl/lib/Clownfish.pm                    |  1 -
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/1182c0dc/runtime/perl/buildlib/Clownfish/Build/Binding.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/buildlib/Clownfish/Build/Binding.pm 
b/runtime/perl/buildlib/Clownfish/Build/Binding.pm
index c4e7939..99fa1a3 100644
--- a/runtime/perl/buildlib/Clownfish/Build/Binding.pm
+++ b/runtime/perl/buildlib/Clownfish/Build/Binding.pm
@@ -423,6 +423,11 @@ error.
 
 Takes no arguments; if any are supplied, an error will be reported.
 END_DESCRIPTION
+    my $to_perl_pod = <<'END_POD';
+=head2 to_perl()
+
+Tries to convert the object to its native Perl representation.
+END_POD
     my $destroy_pod = <<'END_POD';
 =head2 DESTROY()
 
@@ -432,6 +437,11 @@ END_POD
     $pod_spec->set_synopsis($synopsis);
     $pod_spec->set_description($description);
     $pod_spec->add_method(
+        method => 'To_Host',
+        alias  => 'to_perl',
+        pod    => $to_perl_pod,
+    );
+    $pod_spec->add_method(
         method => 'Clone',
         alias  => 'clone',
     );
@@ -478,6 +488,13 @@ clone(self)
 CODE:
     RETVAL = CFISH_OBJ_TO_SV_NOINC(CFISH_Obj_Clone(self));
 OUTPUT: RETVAL
+
+SV*
+to_perl(self)
+    cfish_Obj *self;
+CODE:
+    RETVAL = (SV*)CFISH_Obj_To_Host(self);
+OUTPUT: RETVAL
 END_XS_CODE
 
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/1182c0dc/runtime/perl/lib/Clownfish.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/lib/Clownfish.pm b/runtime/perl/lib/Clownfish.pm
index 546eda6..35dd891 100644
--- a/runtime/perl/lib/Clownfish.pm
+++ b/runtime/perl/lib/Clownfish.pm
@@ -67,7 +67,6 @@ sub error {$Clownfish::Err::error}
     package Clownfish::Obj;
     our $VERSION = '0.004000';
     $VERSION = eval $VERSION;
-    use Clownfish qw( to_clownfish to_perl );
     use Carp qw( confess );
     # Clownfish objects are not thread-safe.
     sub CLONE_SKIP { 1; }

Reply via email to