1 matches bool, 2 matches long

Tove tove at fransson.se
Fri Apr 26 14:32:31 PDT 2013


On Friday, 26 April 2013 at 21:01:17 UTC, Brian Schott wrote:
> On Friday, 26 April 2013 at 06:01:27 UTC, Walter Bright wrote:
>> The real issue is do you want to have the implicit conversions:
>>
>> 0 => false
>> 1 => true
>>
>> or would you require a cast?
>
> The idea of a "true number" and a "false number" doesn't make 
> sense, so yes.

I find the current implementation perfectly intuitive and I 
wouldn´t want it any other way... it models the underlying 
hardware, just the way it should be.

Sometimes due to bad coding standards I´m forced to write...
if((.....long expression with not immediately apparent operator 
precedence)!=0)
... absolutely appalling, kills readability with extra () etc. 
doesn´t matter how many years, I was forced to do it, I still 
cringe every time I see a line like that and itch to rewrite it 
more readable.

I also dont know any book(including Knuth), nor online article, 
which doesn´t clearly define it as 0,1... am very confused by the 
reactions in this thread, is my background so different from 
everyone elses?


More information about the Digitalmars-d mailing list