Bools reloaded
Bruno Medeiros
daiphoenixNO at SPAMlycos.com
Fri Mar 3 04:34:18 PST 2006
Don Clugston wrote:
> Bruno Medeiros wrote:
>> Walter Bright wrote:
>>> "Tom" <Tom_member at pathlink.com> wrote in message
>>> news:du049t$2uv2$1 at digitaldaemon.com...
>>>> Yes, PLEASE, WHY?? Just ONE argument against pure bools, only one
>>>> and I shut my
>>>> mouth forever!
>>>
>>> One should be very careful about stepping away from C's implicit
>>> promotion rules for a language that aims to be a successor to C. C
>>> absolutely *buried* Pascal.
>>>
>>
>> Uuh, I'm not sure what Tom meant by "pure bools", nor I'm sure what
>> you meant by "C's implicit promotion rules" (as C doesn't even have a
>> bool). But ok, nevermind, let's pause for a moment, and get our facts
>> straight.
>>
>> What exactly is it in bools that you Walter, want and not want?
>> I already know that the ability to write 'while(1)' as the same as
>> 'while(true)' is one of them, but, anything more?
>> Is the behaviour of having an "implicit promotion" something you want
>> too?
>> If so, promotion from where, from int to bool, or from bool to int?
>> Do you want or not want bool numeric operations to be an error (like
>> boolA / boolB*2) ?
>
>
> I think one use case that is important is to be able to use bool to
> connect to C APIs (such as the Windows SDK) that use BOOL (a short).
>
Don't hamper D because of that. Better solution then is to keep that
separate from D's bool, no? :
alias BOOL short.
--
Bruno Medeiros - CS/E student
"Certain aspects of D are a pathway to many abilities some consider to
be... unnatural."
More information about the Digitalmars-d
mailing list