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

$_ variable disappears after Rakudo sees block in for @array -> $variable {} #2881

Closed
p6rt opened this issue Sep 1, 2012 · 6 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Sep 1, 2012

Migrated from rt.perl.org#114696 (status was 'resolved')

Searchable as RT114696$

@p6rt
Copy link
Author

p6rt commented Sep 1, 2012

From glitchmr@myopera.com

Following code​:

  $_ = 'Moo';
  for .chars ... 1 -> $len {
  .perl.say;
  {
  .perl.say;
  }
  }

Should return​:

  "Moo"
  "Moo"

But returns​:

  "Moo"
  Mu

@p6rt
Copy link
Author

p6rt commented Aug 18, 2014

From @peschwa

On Sat Sep 01 06​:59​:56 2012, glitchmr@​myopera.com wrote​:

Following code​:

$\_ = 'Moo';
for \.chars \.\.\. 1 \-> $len \{
    \.perl\.say;
    \{
        \.perl\.say;
    \}
\}

Should return​:

"Moo"
"Moo"

But returns​:

"Moo"
Mu

This seems fixed as of now.

19​:47 <psch> m​: $_ = 'Moo'; for .chars ... 1 -> $len { .perl.say; { .perl.say; } }
19​:47 <camelia> rakudo-moar ddfb57​: OUTPUT<<"Moo"NL"Moo"NL"Moo"NL"Moo"NL"Moo"NL"Moo"NL>>

Not sure in how far tests are needed.

@p6rt
Copy link
Author

p6rt commented Aug 18, 2014

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

@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

From @usev6

Since this works as expected, I added a test to S04-declarations/implicit-parameter.t with the following commit​: Raku/roast@7192d95e4b and I'm closing this ticket.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

From @usev6

Since this works as expected, I added a test to S04-declarations/implicit-parameter.t with the following commit​: Raku/roast@7192d95e4b and I'm closing this ticket.

@p6rt p6rt closed this as completed Oct 16, 2014
@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

@usev6 - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant