1 matches bool, 2 matches long

deadalnix deadalnix at gmail.com
Fri Apr 26 18:45:13 PDT 2013


On Friday, 26 April 2013 at 21:32:32 UTC, Tove wrote:
> 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.
>

That is totally irrelevant as a cast is already inserted 
automatically.


More information about the Digitalmars-d mailing list