On Fri, Jun 25, 2004 at 03:38:51PM +0200, [EMAIL PROTECTED] wrote:
> 
> 
>    Hello,
> 
>  I have a wish for Perl6. I think it would be nice to have the possibility
>  for more than one modifier after a simple statement.
> 
>   For example:
> 
>    print $a+$b if $a if $b for 1..3;
> 
> 
>   Gerd Pokorra



There are two kind of modifiers, loop modifiers and simple test
modifiers. 

It is unpossible to stack loop modifiers without adding
conventions denoting the iterators. One could use as many
underscores as the depth of the iterator. Countins underscore
would not be a problem knowing that a depth of more than three is
probably pathologic. Note that this convention could go as well
for embedded normal loop without contextualizers.


  print "$_ $__ "   for 'a'.. 'b' for  1..2

    would print

  1a 1b 2a 2b


Consecutive test modifiers can be replaced by a C<or> or a
C<and>, or better by a C<||> or <C&&> because the alphabetic
version looks too much like a modifier.

But too much stacking of modifiers is probably not a good idea.
My own take would be to support at most two modifiers of
different kind per statement That is at most one loop modifier
and at most one simple test modifier per statement.

But, in previous mails, Larry ruled for at most one modifier.


-- 
 stef

Reply via email to