On Tue, 29 Aug 2000 19:06:24 -0600, Tom Christiansen wrote:

>>I feel that this ought to have worked, i.e. that the scope of the
>>lexical kicked in in the middle of the expression, at the transition
>>over the shortcut operator "&&".
>
>Except that then you can't say
>
>    local $x = $x;
>or
>    my $x = $x;

Yes you could, well, you ought to be able to do it, but implementing
this could be pretty tricky.

For example:

        $x = 123;
        {
            my $x = 2*$x and print "\$x is nonzero, value = $x\n";
        }

should print 246 in the string.

First the expression on the left is evaluated, using the global, the
result is assigned to the lexical. When continuing after "and", the
lexical should be in scope, and get printed.

A bit tricky, but I think it would be rather DWIMmy. There is a
garanteed sequence in execution, not only in practice, but in the
programmer's head too. It's two statements joined together into one.

But we're digressing from the subject line.

-- 
        Bart.

Reply via email to