DMD 0.148 release

Georg Wrede georg at nospam.org
Sun Feb 26 15:29:07 PST 2006


Ivan Senji wrote:
> Georg Wrede wrote:
> 
>> Derek Parnell wrote:
>>
>>> On Mon, 27 Feb 2006 06:05:13 +1100, Georg Wrede <georg at nospam.org> 
>>> wrote:
>>
>>
>>
>>>> We've all had our fights with C, C++, and other related languages. 
>>>> But  honestly, how many of us can confess to having problems with 
>>>> logical  values?
>>>
>>>
>>>
>>> Me.
>>>
>>>> And if someone here has such problems, I suggest switching to VB.
>>>
>>>
>>>
>>> I am also a VB coder and I'm not a language bigot.
>>
>>
>>
>> Oh. I'm sorry. I'll try not to mention VB in the future.
>>
>> ---
>>
>> I think we've gotten it backwards here, so let's turn the table:
>>
>> Can you give some example code and use cases where we absolutely need 
>> your kind of booleans?
> 
> 
> Ok, I'll give an example of that right after you give an example of why 
> and where this is needed/good/(not extremly bad):
> 
>   bool a, b, c;
>   a = true;
>   b = true;
>   c = true;
> 
>   a = b+c; // true + true is what?

That's why we do want to have booleans. The whole point of having 
booleans is to not do that by mistake.

>   if(5) //if 5 what? what does that mean (except nothing)?

Ever seen this:

while(1)

written in source code?

Or this:

c = getCharacter(inf);
if (c) { /* whatever */ }


Oh, by the way, just checked how many times 'while(1)' appears in 
src/phobos/std:

grep "while *( *1 *)" *.d |wc

answer: 16 times.

---

Now, let's see your promised example.



More information about the Digitalmars-d-announce mailing list