develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33675 - trunk/languages/perl6/src/pmc

From:
jonathan
Date:
December 8, 2008 16:10
Subject:
[svn:parrot] r33675 - trunk/languages/perl6/src/pmc
Message ID:
20081209001009.6489BCB9AF@x12.develooper.com
Author: jonathan
Date: Mon Dec  8 16:10:08 2008
New Revision: 33675

Modified:
   trunk/languages/perl6/src/pmc/perl6multisub.pmc

Log:
[rakudo] Implement clone method in Perl6MultiSub.

Modified: trunk/languages/perl6/src/pmc/perl6multisub.pmc
==============================================================================
--- trunk/languages/perl6/src/pmc/perl6multisub.pmc	(original)
+++ trunk/languages/perl6/src/pmc/perl6multisub.pmc	Mon Dec  8 16:10:08 2008
@@ -1006,6 +1006,24 @@
         GETATTR_Perl6MultiSub_candidates(interp, SELF, candidates);
         return VTABLE_get_pmc_keyed(interp, candidates, p);
     }
+
+/*
+
+=item VTABLE PMC * clone()
+
+Makes a copy of this Perl6MultiSub PMC.
+
+=cut
+
+*/
+    VTABLE PMC * clone() {
+        PMC *copy = pmc_new(interp, SELF->vtable->base_type);
+        PMC *unsorted;
+        GETATTR_Perl6MultiSub_candidates(interp, SELF, unsorted);
+        unsorted = VTABLE_clone(interp, unsorted);
+        SETATTR_Perl6MultiSub_candidates(interp, copy, unsorted);
+        return copy;
+    }
 }
 
 /*



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About