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

START block phasers in statement-modifying for-loops do not work #2899

Closed
p6rt opened this issue Sep 14, 2012 · 5 comments
Closed

START block phasers in statement-modifying for-loops do not work #2899

p6rt opened this issue Sep 14, 2012 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Sep 14, 2012

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

Searchable as RT114914$

@p6rt
Copy link
Author

p6rt commented Sep 14, 2012

From @moritz

21​:50 < moritz> r​: say START { 42 } for 1, 2
21​:50 <+p6eval> rakudo a19ce8​: OUTPUT«Mu()␤Mu()␤»

But this works​:

21​:50 < moritz> r​: say START 42 for 1, 2
21​:50 <+p6eval> rakudo a19ce8​: OUTPUT«42 42␤»

as does this​:

21​:52 < moritz> r​: for 1, 2 { say START 42 }
21​:52 <+p6eval> rakudo a19ce8​: OUTPUT«42␤42␤»

@p6rt
Copy link
Author

p6rt commented Jul 19, 2015

From @perlpilot

The C<START> phaser has been deprecated in favor of the C<once> statement prefix (see Raku/old-design-docs@fca7f5a), but the semantics appear to be the same​:

➤ ./perl6

say once { 42 } for 1, 2;
(Mu)
(Mu)
say once 42 for 1, 2;
42 42
for 1, 2 { say once 42 }
42
42

➤ ./perl6 --version
This is perl6 version 2015.06-275-g48c0ba5 built on MoarVM version 2015.06-98-gf22142b

On Fri Sep 14 12​:52​:38 2012, moritz wrote​:

21​:50 < moritz> r​: say START { 42 } for 1, 2
21​:50 <+p6eval> rakudo a19ce8​: OUTPUT«Mu()␤Mu()␤»

But this works​:

21​:50 < moritz> r​: say START 42 for 1, 2
21​:50 <+p6eval> rakudo a19ce8​: OUTPUT«42 42␤»

as does this​:

21​:52 < moritz> r​: for 1, 2 { say START 42 }
21​:52 <+p6eval> rakudo a19ce8​: OUTPUT«42␤42␤»

--
perlpilot

@p6rt
Copy link
Author

p6rt commented Dec 11, 2015

From @jnthn

On Sun Jul 19 02​:53​:08 2015, duff wrote​:

The C<START> phaser has been deprecated in favor of the C<once>
statement prefix (see
Raku/old-design-docs@fca7f5a),
but the semantics appear to be the same​:

➤ ./perl6

say once { 42 } for 1, 2;
(Mu)
(Mu)

Fixed this one​:

$ perl6-m -e "say once { 42 } for 1, 2;"
42
42

Tests in S04-statements/once.t.

say once 42 for 1, 2;
42 42

Will also note that this one is correct due to precedence.

/jnthn

@p6rt
Copy link
Author

p6rt commented Dec 11, 2015

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

@p6rt
Copy link
Author

p6rt commented Dec 11, 2015

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

@p6rt p6rt closed this as completed Dec 11, 2015
@p6rt p6rt added the testneeded label Jan 5, 2020
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