Re: more than one modifier

2004-06-28 Thread Dan Sugalski
On -1 xxx -1, it was written:


  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.

Larry's ruled that it's one statement modifier per statement, period. For
anything else you'd need to modify the grammar. (Which won't be difficult)

Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk



Re: more than one modifier

2004-06-25 Thread Juerd
Please configure your email client correctly.

(I'm surprised that the message was accepted, even)



[EMAIL PROTECTED] skribis 2004-06-25 13:38 (-):
  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.

Has been discussed more than once already. Please read the older
messages first.

http://www.mail-archive.com/[EMAIL PROTECTED]/msg27900.html

print $a+$b if $a if $b for 1..3;

The double if doesn't make a lot of sense. What's wrong with and?

print $a + $b if $a and $b for 1..3;

Or, with just one statement modifier, as if is just a fancy and (or
vice versa):

$a and $b and print $a + $b for 1..3;


Juerd


Re: more than one modifier

2004-06-25 Thread Stéphane Payrard
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 Cor or a
Cand, 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


Re: more than one modifier

2004-06-25 Thread Juerd
Stéphane Payrard skribis 2004-06-25 16:15 (-0400):
 It is unpossible to stack loop modifiers without adding
 conventions denoting the iterators.

Is it really? I've always thought this would be useful enough:

say .{foo} for @$_ for @foo;

Although that can probably just be written as:

say .{foo} for @@foo;  # Looks strange. Is this correct?


Juerd