Juerd wrote:

Which can also be written as:

    do { do { say 1 if 1 } if 1 } if 1;

Sorry, no it can't. From S4
(http://dev.perl.org/perl6/doc/design/syn/S04.html#The_repeat_statement):

   "Unlike in Perl 5, applying a statement modifier to a do block is
   specifically disallowed

Which if crammed together the way you wrote it, turns into:

    do {do {say 1 if 1} if 1} if 1;

Or perhaps you like this even better:

    do{do{say 1 if 1}if 1}if 1;

I find that hard to guess. I personally think the statement is confusing
anyhow, with or without whitespace. Besides, stacked "if"-statements
really don't make any sense. We've already got "and" for that! :)

    say 1 if 1 and 1 and 1;

Oh, and 1 is always true. So you could just write:

    say 1;

Which seems like a great improvement.

It may be more useful to discuss this issue using less contrived
examples. :)
--
korajn salutojn,

  juerd waalboer:  perl hacker  <[EMAIL PROTECTED]>  <http://juerd.nl/sig>
  convolution:     ict solutions and consultancy <[EMAIL PROTECTED]>

Reply via email to