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

Array objects in item context in for loops flatten in Rakudo #1589

Closed
p6rt opened this issue Mar 7, 2010 · 5 comments
Closed

Array objects in item context in for loops flatten in Rakudo #1589

p6rt opened this issue Mar 7, 2010 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 7, 2010

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

Searchable as RT73398$

@p6rt
Copy link
Author

p6rt commented Mar 7, 2010

From @masak

<arnsholt> rakudo​: my $i = 0; $i++ for [1,2,3]; say $i;
<p6eval> rakudo d32a0c​: OUTPUT«3␤»
<masak> alpha​: my $i = 0; $i++ for [1,2,3]; say $i;
<p6eval> alpha 30e0ed​: OUTPUT«1␤»
<masak> hm.
<masak> I agree with alpha here.
<moritz_> looks much like a bug
<moritz_> (in master)
<masak> pugs​: my $i = 0; $i++ for [1,2,3]; say $i;
<p6eval> pugs​: OUTPUT«1␤»
* masak submits rakudobug
<arnsholt> masak​: Good. Because it's in the spectest suite =)
<arnsholt> Any suggestions for what is wrong?
<masak> arnsholt​: it's flattening the array.
<moritz_> objectref or interpolating flag

@p6rt
Copy link
Author

p6rt commented Jun 29, 2010

From @bbkr

On Kiev build​:

$ perl6 -e 'my $i = 0; $i++ for [1,2,3]; say $i;'
1

Taking ticket for tests.

@p6rt
Copy link
Author

p6rt commented Jun 29, 2010

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

@p6rt
Copy link
Author

p6rt commented Jun 29, 2010

From @bbkr

Following test

{
  my $arrayref = [1,2,3];

  my $count=0;
  for $arrayref { $count++ }

  is $count, 1, 'for $arrayref {...} executes the loop body only once';
}

is already present & working in Pugs 31498 revision.

@p6rt
Copy link
Author

p6rt commented Jun 29, 2010

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

@p6rt p6rt closed this as completed Jun 29, 2010
@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