From: Austin Hastings [mailto:[EMAIL PROTECTED]]
> 
> for @A {
>   for @B -> $x {
>     when /a/ $_ -> $a { s/a/b/; ... $a ...; }
>   }
> }
> 
> Once we get inside the curlies, $_ is aliased to the localized var for
> the C<when> (in this case, $x).

I went back and read the Apocolypse 4: RFC 022. I may even understand it
this time through. At least, I no longer have a brain fart when reading the
code above. -Speaking of which, you forgot your trailing semicolon for the
C<when> expression's final closure/block.

Why does C<when>'s EXPR pay attention to the topicalizer regardless of
associated variable?

Why introduce the special case? Especially when consistency and
simplification seem to be a strong undercurrent in Perl6? I'm curious what
the reasoning behind the special case is. I don't see what it gives us...
beside one more thing to remember. What would be a use case that illustrates
the need for the special case? And is the special case the common one?

$_ = 'foo';
given 'bar' -> $f {
  if   /foo/ {print};       # true, prints 'foo'
  when /bar/ {print};       # true, prints 'foo'
  when /bar/ -> $g {print}; # true, prints what? 'foo'
}

Reply via email to