Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
p6rt opened this issue May 30, 2014 · 3 comments
Open

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

p6rt opened this issue May 30, 2014 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 30, 2014

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

Searchable as RT121991$

@p6rt
Copy link
Author

p6rt commented May 30, 2014

From @masak

<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

@p6rt
Copy link
Author

p6rt commented Sep 10, 2017

From @smls

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

<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.

@p6rt
Copy link
Author

p6rt commented Sep 10, 2017

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

@p6rt p6rt added the at_larry label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant