Author: jonathan
Date: Wed Dec 3 16:03:33 2008
New Revision: 33469
Modified:
trunk/languages/perl6/src/builtins/guts.pir
Log:
[rakudo] Track changes in namespace/class symbol handling in Parrot in code to
convert multis to Perl6MultiSub.
Modified: trunk/languages/perl6/src/builtins/guts.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/guts.pir (original)
+++ trunk/languages/perl6/src/builtins/guts.pir Wed Dec 3 16:03:33 2008
@@ -274,9 +274,7 @@
$S0 = typeof current_thing
if $S0 == 'MultiSub' goto not_perl6_multisub
.return()
-
- # It's not a Perl6MultiSub, create one, shift contents and install in
- # the namespace.
+ # It's not a Perl6MultiSub, create one and put contents into it.
not_perl6_multisub:
.local pmc p6multi, sub_iter
p6multi = new 'Perl6MultiSub'
@@ -287,16 +285,18 @@
push p6multi, $P0
goto iter_loop
iter_loop_end:
- namespace[name] = p6multi
- # If the namespace is associated with a class, need to update the method
- # entry in that too.
+ # If the namespace is associated with a class, need to remove the method
+ # entry in that; inserting the new multi into the namespace will then
+ # also add it back to the class.
.local pmc class
class = get_class namespace
if null class goto no_class
class.'remove_method'(name)
- class.'add_method'(name, p6multi)
no_class:
+
+ # Make new namespace entry.
+ namespace[name] = p6multi
.return()
error: