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

The optional $_ seems to default to $CALLER::_, not $OUTER::_ in Rakudo #2216

Open
p6rt opened this issue Oct 7, 2010 · 3 comments
Open
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 7, 2010

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

Searchable as RT78278$

@p6rt
Copy link
Author

p6rt commented Oct 7, 2010

From @masak

<tylercurtis> Actually, maybe { /O/ } should be -> $_? { /O/ }
<masak> it is.
<masak> rakudo​: my $b = { /O/ }; say $b.signature.count; say $b.signature.arity
<p6eval> rakudo 377615​: OUTPUT«1␤0␤»
<jnthn> I'ts more like -> $_ = $OUTER​::_ I guess
<masak> fair enuf.
<tylercurtis> Well, yes, that.
<masak> OUTER, and not CALLER?
<masak> rakudo​: my $b; { $_ = 5; $b = { .say } }; $_ = 42; $b()
<p6eval> rakudo 377615​: OUTPUT«42␤»
<masak> seems to me $_ defaults to $CALLER​::_
* masak submits rakudobug
<tylercurtis> How does that distinguish between $OUTER​::_ and
$CALLER​::_? The calling scope is the same as the outer scope, no?
<masak> no, the outer scope has $_ = 5, but the calling scope has $_ = 42
<jnthn> rakudo​: my $b; { my $_ = 5; $b = { .say } }; $_ = 42; $b()
<p6eval> rakudo 377615​: OUTPUT«5␤»

jnthn says that the problem is that there's a binding to the outer
container rather than an assignment, and that the last evaluation
shows this.

@p6rt
Copy link
Author

p6rt commented Apr 7, 2016

From @diakopter

new behavior​:

12​:18 <diakopter> m​: my $b; { my $_ = 5; $b = { .say } }; $_ = 42; $b()
12​:18 <camelia> rakudo-moar 61d231​: OUTPUT«Potential difficulties​:␤ Redeclaration of symbol $_␤ at
  /tmp/7gI9FhwrCH​:1␤ ------> my $b; { my $_⏏ = 5; $b = { .say } }; $_ = 42; $b()␤42␤»

@p6rt
Copy link
Author

p6rt commented Apr 7, 2016

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

@p6rt p6rt added the Bug 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