--- Juerd <[EMAIL PROTECTED]> wrote:
> Austin Hastings skribis 2004-06-24 14:29 (-0700):
> > >   $foo as boolean
> > "This is Perl 6.  Everything is an object, or at least pretends to
> > be one. Everything has a .boolean method that returns 0 or 1."
> 
> If I understand the current design correctly, having both .boolean
> and casting via "as" would mean that "$foo.boolean" and "$foo as 
> Bool" and "$foo as Bit" mean the same in boolean context, but the
> first literally is 1 or 0, the second is true or false and the 
> third is 1 or 0 again.

I don't think so. Specifically, I'd expect

    $x = 0 but true;
    print $x.boolean; # 1
    print ($x as Bit); # 0
    # (I don't know about 'Bool')

> Is this complexity really needed?

I'd say yeah, it is. 0-but-true is pretty nice to have. (Finally the
system calls can return something other than -1.)

> Juerd

=Austin

Reply via email to