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

[svn:parrot] r33374 - branches/call_conv_redux/src

From:
Whiteknight
Date:
November 30, 2008 09:52
Subject:
[svn:parrot] r33374 - branches/call_conv_redux/src
Message ID:
20081130175232.D41A8CB9AF@x12.develooper.com
Author: Whiteknight
Date: Sun Nov 30 09:52:32 2008
New Revision: 33374

Modified:
   branches/call_conv_redux/src/multidispatch.c

Log:
[call_conv_redux] update Parrot_mmd_build_type_tuple_from_sig_obj

Modified: branches/call_conv_redux/src/multidispatch.c
==============================================================================
--- branches/call_conv_redux/src/multidispatch.c	(original)
+++ branches/call_conv_redux/src/multidispatch.c	Sun Nov 30 09:52:32 2008
@@ -1338,15 +1338,24 @@
                 break;
             case 'P':
             {
-                PMC *pmc_arg = VTABLE_get_pmc_keyed_int(interp, sig_obj, i);
-                if (PMC_IS_NULL(pmc_arg))
-                    VTABLE_set_integer_keyed_int(interp, type_tuple,
-                            i, enum_type_PMC);
-                else
-                    VTABLE_set_integer_keyed_int(interp, type_tuple, i,
-                            VTABLE_type(interp, pmc_arg));
+                INTVAL type_lookahead = string_index(interp, string_sig, (i + 1));
+                if (type_lookahead == 'i') {
+                    if (i != 0)
+                        Parrot_ex_throw_from_c_args(interp, NULL,
+                            EXCEPTION_INVALID_OPERATION,
+                            "Multiple Dispatch: 'i' adverb modifier may only be used on the invocant");
+                }
+                else {
+                    PMC *pmc_arg = VTABLE_get_pmc_keyed_int(interp, sig_obj, i);
+                    if (PMC_IS_NULL(pmc_arg))
+                        VTABLE_set_integer_keyed_int(interp, type_tuple,
+                                i, enum_type_PMC);
+                    else
+                        VTABLE_set_integer_keyed_int(interp, type_tuple, i,
+                                VTABLE_type(interp, pmc_arg));
 
-                break;
+                    break;
+                }
             }
             case '-':
                 args_ended = 1;



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