Dave Storrs writes:
 > is a Bad Thing and is going to cause a lot of bugs. I have the following
 > problems with it:
 > 
 >      for @a; @b -> $x is rw; $y { $x = $y[5] };
 > 
 >      1) This is (AFAIK) the ONLY place in Perl where a semicolon that
 > is not enclosed in parens is used for anything other than "end of
 > statement" (semi is used to separate parts of a perl5 C-style for loop
 > control statement, but that's in parens, so there is an indication that
 > the statement isn't over yet).
 > 

in principle , first ";" can be "labelled" as stream separator since
parser know that for is expecting { closure } ; 
the second ";"  - is distinguished from ";" statement separator ,
since we know that we are inside sub signature and there have to be a
block . That's how I understand it. 



 >              for @a ~> $x< __ @b ~> $y { $x = $y[5] };
 >              for @a )~ $x<, $z __ @b )~ $y { $x = $y[5] };
 >              for @a _ @b __ $x<, $z _ $y { $x = $y[5] };
 >              for @a _ @b )~ $x<, $z _ $y { $x = $y[5] };
 >              for @a _ @b ]~ <$x, $z _ $y { $x = $y[5] };
 > 
 >      There were actually a bunch of others, but they were even less
 > satisfying.

for @a -> $x is rw ; 
    @b -> $y 
  { ... } ;

for @a       ;  @b -> 
    $x is rw ;  $y 
  { ... } 

arcadi . 

Reply via email to