develooper Front page | perl.perl6.language | Postings from July 2001

Re: if then else otherwise ...

Thread Previous | Thread Next
From:
John Porter
Date:
July 29, 2001 08:32
Subject:
Re: if then else otherwise ...
Message ID:
20010729113213.A27334@min.net
David Grove wrote:
> There is no ternary state for a boolean value. True/False, Yes/No, On/Off, 
> 1/0. Are you suggesting Yes/No/Maybe? Or are you redefining True and False?

He's suggesting True/False/-True (as in, 1/0/-1, which is what you get
from cmp and <=>).  How hard is that to understant?


> What you're asking has no counterpart in boolean logic, and 
> as such would make no sense in any computer language. 

Screw boolean.  It's just a three-way switch, exactly as if/else
is a two-way switch.  (As has been noted, switch() would handle this
and the more general case.)

-- 
John Porter


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About