Skip Menu |
Report information
Id: 121991
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] Unless 'use soft' is in play, .wrap should die in Rakudo
From: Carl Mäsak <cmasak [...] gmail.com>
Date: Fri, 30 May 2014 18:50:59 +0200
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 912b
<Timbus> m: sub a {"foo"}; sub b {"bar"~callsame}; &a.wrap(&b); say a(); <camelia> rakudo-moar 90cd58: OUTPUT«foo␤» <masak> um. <Timbus> optimizer ate it <masak> that would be my guess, too. * masak submits rakudobug <moritz> not a bug * masak doesn't submit rakudobug <moritz> iirc you need a special pragma if you want to replace lexials <masak> oh. <Timbus> that would, not be good for the test suite then <Timbus> wait is that 'use soft;' <moritz> m: use soft; sub a {"foo"}; sub b {"bar"~callsame}; &a.wrap(&b); say a(); <camelia> rakudo-moar 90cd58: OUTPUT«barfoo␤» <moritz> Timbus: aye <moritz> most of our optimizations rely on the fact the lexicals are restricted in some ways at compile time <masak> as they should. <TimToady> seems to me that &a.wrap(&b); ought to fail if &a has been hardened at CHECK time, and that's the bug that masak++ should submit * masak submits &a.wrap(&b) rakudobug
Download (untitled) / with headers
text/plain 504b
On Fri, 30 May 2014 09:51:18 -0700, masak wrote: Show quoted text
> <Timbus> m: sub a {"foo"}; sub b {"bar"~callsame}; &a.wrap(&b); say a(); > <camelia> rakudo-moar 90cd58: OUTPUT«foo␤»
This now works: ➜ sub a {"foo"}; sub b {"bar"~callsame}; &a.wrap(&b); say a(); barfoo Is TimToady's recommendation of forbidding `.wrap` on routines that aren't under `use soft`, still relevant? --- This is Rakudo version 2017.08-104-g76f1d8970 built on MoarVM version 2017.08.1-148-g1059eed1 implementing Perl 6.c.


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