Skip Menu |
Report information
Id: 78870
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] Wrapping a detached method breaks method deferral in Rakudo
Date: Sat, 6 Nov 2010 18:44:35 +0100
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 471b
<masak> rakudo: class A { method foo { say "A" } }; class B is A { method foo { say "B"; nextsame } }; B.new.foo <p6eval> rakudo 142d22: OUTPUT«B␤A␤» <masak> rakudo: class A { method foo { say "A" } }; class B is A { method foo { say "B"; nextsame } }; my &x = B.WALK(:name<foo>)[0]; &x.wrap: { say "wrap"; nextsame }; x(B.new) <p6eval> rakudo 142d22: OUTPUT«wrap␤B␤» * masak submits rakudobug <masak> why doesn't the last evaluation print "wrap␤B␤A␤"?
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 1.2k
masak (>): Show quoted text
> <masak> rakudo: class A { method foo { say "A" } }; class B is A { > method foo { say "B"; nextsame } }; B.new.foo > <p6eval> rakudo 142d22: OUTPUT«B␤A␤» > <masak> rakudo: class A { method foo { say "A" } }; class B is A { > method foo { say "B"; nextsame } }; my &x = B.WALK(:name<foo>)[0]; > &x.wrap: { say "wrap"; nextsame }; x(B.new) > <p6eval> rakudo 142d22: OUTPUT«wrap␤B␤» > * masak submits rakudobug > <masak> why doesn't the last evaluation print "wrap␤B␤A␤"?
<jnthn> masak: hmm <jnthn> masak: I can kinda see why it's happening. <jnthn> masak: It feels wrong. <masak> what feels wrong? <jnthn> That wrapping it breaks the deferal up the MRO <masak> jnthn: yes -- that's the title of my bug report :) <jnthn> masak: To make it work, the current candidate list kinda needs to get "collected" or something. <jnthn> When it gets to the ponit of being fully iterated. <jnthn> So we fall to the otuer dispatcher's idea of current candidate list. <masak> jnthn: ok. <jnthn> e.g. empty = implicit pop * masak adds all this to the ticket <masak> conceptually, I don't see any problem. <jnthn> No, I don't have an immediate example of a problem we'd cause or some extra fragility it'd introduce. <jnthn> Tend to be a little knee-jerky against implicit magic, that's all. :-)
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 424b
new behavior: 12:16 <diakopter> rakudo: class A { method foo { say "A" } }; class B is A { method foo { say "B"; nextsame } }; my &x = B.WALK(:name<foo>)[0]; &x.wrap: { say "wrap"; nextsame }; x(B.new) 12:16 <camelia> rakudo-moar 61d231: OUTPUT«wrap␤B␤Attempt to return outside of any Routine␤ in block <unit> at /tmp/tmpfile line 1␤␤»


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org