Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

Unless 'use soft' is in play, .wrap should die in Rakudo #3400

Open p6rt opened 10 years ago

p6rt commented 10 years ago

Migrated from rt.perl.org#121991 (status was 'open')

Searchable as RT121991$

p6rt commented 10 years ago

From @masak

\ m​: sub a {"foo"}; sub b {"bar"~callsame}; &a.wrap(&b); say a(); \ rakudo-moar 90cd58​: OUTPUT«foo␤» \ um. \ optimizer ate it \ that would be my guess, too. * masak submits rakudobug \ not a bug * masak doesn't submit rakudobug \ iirc you need a special pragma if you want to replace lexials \ oh. \ that would, not be good for the test suite then \ wait is that 'use soft;' \ m​: use soft; sub a {"foo"}; sub b {"bar"~callsame}; &a.wrap(&b); say a(); \ rakudo-moar 90cd58​: OUTPUT«barfoo␤» \ Timbus​: aye \ most of our optimizations rely on the fact the lexicals are restricted in some ways at compile time \ as they should. \ 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

p6rt commented 6 years ago

From @smls

On Fri, 30 May 2014 09​:51​:18 -0700, masak wrote​:

\ m​: sub a {"foo"}; sub b {"bar"~callsame}; &a.wrap(&b); say a(); \ 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.

p6rt commented 6 years ago

The RT System itself - Status changed from 'new' to 'open'