develooper Front page | perl.perl6.language | Postings from September 2006

Re: Questions about statement modifiers

Thread Previous
From:
Larry Wall
Date:
September 1, 2006 09:15
Subject:
Re: Questions about statement modifiers
Message ID:
20060901161454.GA19922@wall.org
On Wed, Aug 30, 2006 at 01:37:33PM +0800, Agent Zhang wrote:
: Hi, there~
: 
: 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;

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

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About