Bools reloaded

Oskar Linde oskar.lindeREM at OVEgmail.com
Fri Mar 3 11:19:09 PST 2006


Ivan Senji wrote:
> Don Clugston wrote:
>> Sorry, that's still not clear.
>> Bruno is right, terms like "pure bools" or "purist bools" are vague, 
>> you can't expect everyone to know what you mean.
>>
>> For example: do you want "&" to be legal for bool types, or just "&&"?
> 
> Just &&.

Why? Ever heard of boolean algebra? Why should &,|,^,~ not be defined 
and allowed for bool? It would be problematic and inconsistent not 
having non-short-circuit operators for booleans.

>> (they mean very different things for integers). "&" normally means 
>> "bitwise and", but a pure bool doesn't have any bits.
>> Is it legal to cast from a bool to some other type?
> 
> I'm not against casting but implicit conversions are bad.

Do you mean that all implicit conversions are bad? Are the integer 
promotion rules bad?

/Oskar



More information about the Digitalmars-d mailing list