Author: Whiteknight
Date: Tue Aug 19 16:16:44 2008
New Revision: 30361

Modified:
   branches/pdd27mmd/src/pmc/multisub.pmc

Log:
[PMC] add stubs for get_pmc_keyed and get_pmc_keyed_string vtable methods. Add 
basic implementation of a get_iter method, which relies on these two vtable 
methods being implemented.

Modified: branches/pdd27mmd/src/pmc/multisub.pmc
==============================================================================
--- branches/pdd27mmd/src/pmc/multisub.pmc      (original)
+++ branches/pdd27mmd/src/pmc/multisub.pmc      Tue Aug 19 16:16:44 2008
@@ -79,21 +79,39 @@
     }
 
     VTABLE PMC *get_pmc() {
-        PMC * const list = Parrot_mmd_sort_manhattan(INTERP, SELF);
+        PMC * list = Parrot_mmd_sort_manhattan(INTERP, SELF);
 
         if (PMC_IS_NULL(list))
             Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "No applicable 
methods.\n");
-
         return list;
     }
 
+/*
+    VTABLE PMC *get_pmc_keyed(PMC *key) {
+    }
+
+    VTABLE PMC *get_pmc_keyed_string(STRING *s) {
+    }
+*/
+
     /* stub get_iter method. Takes an argument list PMC, sorts the subs in the
        multi according to the closeness to that list, and returns an iterator
        over the sorted list of subs. Or, it could take a string PMC where
        type letters (P S N I) are whitespace delimited. */
-    METHOD PMC *get_iter(PMC *list) {
+/*
+    METHOD PMC *get_iter(PMC *args) {
+        STRING * const _array  = CONST_STRING(interp, "Array");
+        STRING * const _string = CONST_STRING(interp, "String");
+
+        if (VTABLE_isa(INTERP, args, _array))
+            return VTABLE_get_pmc_keyed(INTERP, SELF, args);
+        else if (VTABLE_isa(INTERP, args, _string))
+            return VTABLE_get_pmc_keyed_string(INTERP, SELF, args);
+        else
+            Parrot_ex_throw_from_c_args(interp, NULL, 
EXCEPTION_INVALID_OPERATION,
+                    "attempt to call get_iter method with invalid arg 
type.\n");
     }
-
+*/
 }
 
 /*

Reply via email to