I think S04 says too little about statement modifiers. Please comment
on the following code samples. Are they valid Perl 6?
do { say } for 1..3;
{ say } for 1..3;
-> $i { say $i } for 1..3;
And how about similar variations for other statement modifiers, such
as while, given, if, until, and unless?
Thanks!
Agent
The do-BLOCK construct does not allow statement modifiers.
: { say } for 1..3;
:
: -> $i { say $i } for 1..3;
These are both legal syntactically, but neither of these do anything
other than produce a closure muliple times without calling it.
: And how about similar variations for other statement modifiers, such
: as while, given, if, until, and unless?
Same. Will clarify S04.
Larry