DMD 0.148 release
Kyle Furlong
kylefurlong at gmail.com
Tue Feb 28 00:18:08 PST 2006
Oskar Linde wrote:
> Tom skrev:
>> In article <du002m$2pnp$1 at digitaldaemon.com>, Ivan Senji says...
>>> Walter Bright wrote:
>>>> "Ivan Senji" <ivan.senji_REMOVE_ at _THIS__gmail.com> wrote in message
>>>>> Walter Bright wrote:
>>
>>> The problem in all these bool wars so far is I never saw an argument
>>> that would be against true booleans (while(BooleanExpression) and all
>>> that...).
>>
>> Yes, PLEASE, WHY?? Just ONE argument against pure bools, only one and
>> I shut my
>> mouth forever!
>>
>> Tom;
>
> Does pure booleans necessarily mean that other types could not be
> implicitly convertible to bool? I would love "pure" booleans (not a
> numeric type, not allowed in arithmetic operations), but I would hate to
> have to write:
>
> if (a !is null || b !is null)
>
> instead of:
>
> if (a || b)
>
I would say that the second construct is much less reliable, maintainable, and safe than the first. Therefore, the type system
should disallow the second with a pure boolean type.
> What is wrong with the second case? (apart from being more readable).
>
> With such "pure" booleans, you could still write:
>
> while(1)
>
> With the classic definition of !0 !null implies true...
>
> /Oskar
More information about the Digitalmars-d-announce
mailing list