DMD 0.148 release
Ivan Senji
ivan.senji_REMOVE_ at _THIS__gmail.com
Sun Feb 26 16:30:13 PST 2006
Georg Wrede wrote:
> Ivan Senji wrote:
>> And if I did missunderstand something I apologize (it's late).
>
>
> No problem. The way this whole thread is going, half the time everybody
> is clueless. :-)
:)
>> Are you now saying you want real booleans that are not ints?
>
>
> On the inside they should be ints. Mostly for efficiency reasons, but
> also for established coding conventions.
I agree completly that on the inside they should be ints for some
reasons. But not as a must. On a different arhitecture something else
might be more efficient.
>
> But on the outside, they should not be compatible with ints.
>
> In other words, doing
>
> bool foo = 55 && 5000;
>
> should be legal,
You trying to scare me away from this thread? ;)
I believe programming language constructs should(mostly) be translatable
to a human language.
but:
if(55){Georg.giveApple();}
means:
if 55 give Georg an apple.
Does Georg expect to get an apple? I really don't know. This doesn't
have any meaning.
> and it should store the 'true value' (that'd be a 1)
> into foo.
If by "store the 'true value' into foo" you mean "compile time error:
cannot implicitly conver from int to bool" than I agree! :)
>
> But doing:
>
> bool a = 1; // legal, but poor coding
> bool b = 0; // likewise
> whateverType bar = a + b; // should produce a compiler error
> // since addition of bools is illegal
Hm! Addition of bools is illegal but assigning random integers into them
is OK.
>>
>> My example was supposed to be an example for:
>> a) real bools being needed
>> b) int bool being bad
>
>
> I'm still waiting.
No need to wait, the examples are there. :)
More information about the Digitalmars-d-announce
mailing list