Author: leo
Date: Fri Apr 22 03:43:35 2005
New Revision: 7906

Removed:
   trunk/src/mmd_fallback.c
Modified:
   trunk/MANIFEST
   trunk/config/gen/makefiles/root.in
   trunk/include/parrot/mmd.h
   trunk/include/parrot/pmc.h
   trunk/src/inter_create.c
   trunk/src/mmd.c
Log:
MMD 36 - cleanup 3: remove mmd_fallback

* classes/scalar.pmc provides reasonable fallbacks for scalars
  and infix<Any, Any>
* remove default_func


Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST      (original)
+++ trunk/MANIFEST      Fri Apr 22 03:43:35 2005
@@ -1615,7 +1615,6 @@
 src/method_util.c                                 []
 src/misc.c                                        []
 src/mmd.c                                         []
-src/mmd_fallback.c                                []
 src/nci_test.c                                    []
 src/objects.c                                     []
 src/packdump.c                                    []

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in  (original)
+++ trunk/config/gen/makefiles/root.in  Fri Apr 22 03:43:35 2005
@@ -407,7 +407,6 @@
     $(SRC_DIR)/pic$(O) \
     $(SRC_DIR)/mmd$(O) \
     $(SRC_DIR)/builtin$(O) \
-    $(SRC_DIR)/mmd_fallback$(O) \
     $(SRC_DIR)/extend$(O) \
     $(SRC_DIR)/revision$(O) \
     $(PF_DIR)/pf_items$(O) \
@@ -875,8 +874,6 @@
 
 $(SRC_DIR)/builtin$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/builtin.str
 
-$(SRC_DIR)/mmd_fallback$(O) : $(GENERAL_H_FILES)
-
 $(SRC_DIR)/objects$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/objects.str
 
 $(SRC_DIR)/packfile$(O) : $(GENERAL_H_FILES)

Modified: trunk/include/parrot/mmd.h
==============================================================================
--- trunk/include/parrot/mmd.h  (original)
+++ trunk/include/parrot/mmd.h  Fri Apr 22 03:43:35 2005
@@ -53,8 +53,6 @@
     funcptr_t *mmd_funcs;     /* The functions for the MMD table */
     UINTVAL x;               /* The x coord for each table */
     UINTVAL y;               /* The y coord for each table */
-    funcptr_t default_func;  /* The function we use if we can't find
-                                 a function */
 } MMD_table;
 
 

Modified: trunk/include/parrot/pmc.h
==============================================================================
--- trunk/include/parrot/pmc.h  (original)
+++ trunk/include/parrot/pmc.h  Fri Apr 22 03:43:35 2005
@@ -44,9 +44,6 @@
 void dod_register_pmc(Interp *, PMC*);
 void dod_unregister_pmc(Interp *, PMC*);
 
-/* multi method fallbacks */
-void register_fallback_methods(Interp *);
-
 /* mro creation */
 void Parrot_create_mro(Interp *, INTVAL);
 

Modified: trunk/src/inter_create.c
==============================================================================
--- trunk/src/inter_create.c    (original)
+++ trunk/src/inter_create.c    Fri Apr 22 03:43:35 2005
@@ -150,7 +150,7 @@
     interpreter->binop_mmd_funcs = NULL;
 
     /* Go and init the MMD tables */
-    register_fallback_methods(interpreter);
+    mmd_add_function(interpreter, MMD_USER_FIRST - 1, (funcptr_t)0);
 
     /* create caches structure */
     init_object_cache(interpreter);

Modified: trunk/src/mmd.c
==============================================================================
--- trunk/src/mmd.c     (original)
+++ trunk/src/mmd.c     Fri Apr 22 03:43:35 2005
@@ -75,11 +75,6 @@
 
     x_funcs = table->x;
     y_funcs = table->y;
-    def = table->default_func;
-    if (!def) {
-        printf("default for %d not registered\n", (int)function);
-        return;
-    }
     printf("    ");
     for (x = 0; x < x_funcs; ++x) {
         if (! (x % 10))
@@ -558,10 +553,9 @@
         INTVAL funcnum, funcptr_t function)>
 
 Add a new binary MMD function to the list of functions the MMD system knows
-of. C<func_num> is the number of the new function, while C<default_func> is
-the function to be called when the system doesn't know which function it
-should call. (Because, for example, there hasn't been a function
-installed that matches the left and right types for a call).
+of. C<func_num> is the number of the new function. C<function> is ignored.
+
+TODO change this to a MMD register interface that takes a function *name*.
 
 =cut
 
@@ -586,15 +580,10 @@
             MMD_table *table = interpreter->binop_mmd_funcs + i;
             table->x = table->y = 0;
             table->mmd_funcs = NULL;
-            table->default_func = NULL;
         }
         interpreter->n_binop_mmd_funcs = func_nr + 1;
     }
 
-    /* We mark the new function by adding in the default function
-       pointer */
-    interpreter->binop_mmd_funcs[func_nr].default_func = function;
-
 }
 
 /*

Reply via email to