Alexey Trofimenko writes:
> On Thu, 24 Jun 2004 10:55:26 -0700, Larry Wall <[EMAIL PROTECTED]> wrote:
> 
> 
> >Well, any operator or function that knows how to call a closure can
> >function as a short-circuit operator.  The built-in short-circuit
> >operators are a bit special insofar as they're a kind of macro that
> >treats the right side as an implicit closure without you having to
> >put braces around it.  No reason in principle you couldn't write your
> >own infix macro to do the same thing.
> 
> if I got it right, you mean that in perl6 it would be correct (perl5  
> syntax):
> 
>   $a and my $b=1;
> 
> is the same as
> 
>   $a and do {my $b=1}

No.  It's more like:

    my $b;
    infix:and($a, { $b=1 });

The fact that the my is stated outside the block is an unsolved problem
that is going to be dealt with.  When macros are used, there has to be
something that assigns the inner lexical variables to the correct
lexical scope.  We just don't quite know how we're going to do it yet.  

And of course we want it to be possible to assign it to an incorrect
lexical scope, if the need arises.

Don't worry, the scoping will all work out in these cases... somehow.

Luke

Reply via email to