Author: jonathan
Date: Wed Dec  3 16:04:28 2008
New Revision: 33470

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

Log:
[rakudo] Implement some missing methods and add some documentation to the 
Perl6MultiSub PMC.

Modified: trunk/languages/perl6/src/pmc/perl6multisub.pmc
==============================================================================
--- trunk/languages/perl6/src/pmc/perl6multisub.pmc     (original)
+++ trunk/languages/perl6/src/pmc/perl6multisub.pmc     Wed Dec  3 16:04:28 2008
@@ -816,11 +816,65 @@
         return VTABLE_elements(interp, candidates);
     }
 
+/*
+
+=item VTABLE PMC * get_iter()
+
+Get an iterator over the candidates.
+
+=cut
+
+*/
     VTABLE PMC * get_iter() {
         PMC *candidates;
         GETATTR_Perl6MultiSub_candidates(interp, SELF, candidates);
         return VTABLE_get_iter(interp, candidates);
     }
+
+/*
+
+=item VTABLE PMC * get_pmc_keyed_int()
+
+Gets the candidate at index C<i>.
+
+=cut
+
+*/
+    VTABLE PMC * get_pmc_keyed_int(INTVAL i) {
+        PMC *candidates;
+        GETATTR_Perl6MultiSub_candidates(interp, SELF, candidates);
+        return VTABLE_get_pmc_keyed_int(interp, candidates, i);
+    }
+
+/*
+
+=item VTABLE PMC * get_pmc_keyed_str()
+
+Converts C<s> to an integer and gets the key at that index.
+
+=cut
+
+*/
+    VTABLE PMC * get_pmc_keyed_str(STRING *s) {
+        PMC *candidates;
+        GETATTR_Perl6MultiSub_candidates(interp, SELF, candidates);
+        return VTABLE_get_pmc_keyed_str(interp, candidates, s);
+    }
+
+/*
+
+=item VTABLE PMC * get_pmc_keyed()
+
+Converts C<p> to an integer and gets the key at that index.
+
+=cut
+
+*/
+    VTABLE PMC * get_pmc_keyed(PMC *p) {
+        PMC *candidates;
+        GETATTR_Perl6MultiSub_candidates(interp, SELF, candidates);
+        return VTABLE_get_pmc_keyed(interp, candidates, p);
+    }
 }
 
 /*

Reply via email to