> Two solutions to the problem of accessing 'what' returned false are:
> 
> 1) don't allow it.
> 2) Alias the value of the while/loop/if conditional into a special
> variable.
> 
> while( blah() ) {
>   ..
> } else { print $COND; }
> 
> It's ugly, but it works, and doesn't break the holy scoping rules.

It's also unnecessary. The Holy Scoping Rules actually work in your favour in
this case. In Perl 6 you can just do this:


        while my $cond = blah() {
                ...
        }

and C<$cond> is defined *outside* the block. So if Larry were to allow C<else>
on loops, you'd be able to write:

        while my $cond = blah() {
                ...
        }
        else {
                print $cond;
        }

Given how rarely this kind of thing is actually needed (I've *never* used such
a construct), I suspect that an explicit variable is adequate.

Damian

Reply via email to