February 27, 2006
Georg Wrede wrote:
> 
> 
> This is getting hilarious...
> 
> 
> Ivan Senji wrote:
>> Georg Wrede wrote:
>>
>>> Well, then we could skip the logical operators, right? No more && or ||. Since all booleans would be strictly 0 or 1, they'd become obsolete.
>>
>> What? Did you here this correctly? You are saying remove logical operators (the operators working on booleans in theory)?
>>
>> How would they become obsolete? They would get a meaning with true booleans.
> 
> If Booleans are only 0 or 1, then & and | suffice. && and || become useless, and we can delete them from the compiler sources.
> 
> Not to mention the lots of ink we could save!
> 
>> I must say that i don't have a clue what is the result of 17 && 301?
> 
> I have no problem believing that's true.
> 
>>> And if booleans have to only be 0 or 1, then a whole lot of unnecessary conversions would be happening all over the place. Forget D speed.
>>
>> No they don't. They can be anything they wan't to be. But the compiler should hide that from me and convince me I live in a world of Boolean algebra.
> 
> Since I've just promised not to recommend a certain language from Redmond, maybe I could recommend some substance?
> 
>>> 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?
>>
>> I have problems with bools. I can't sleep at night if they are ints ;)
> 
> Oh. Maybe then a prescription substance?

Georg, reading your posts on this NG has given me great insight into the breadth of your knowledge and the depth of your wisdom. Your sarcasm is always poigniant and appropo. Your jibes at your fellow NG's always in good taste. And your blind cheerleading and bandwagoning the height of prudence and solid judgement. Keep up the good work!
February 27, 2006
Tom wrote:
> Georg Wrede says...
>> Ivan Senji wrote:
>>> Georg Wrede wrote:
>>>> Ivan Senji wrote:
>>>>> Georg Wrede wrote:
>>>>>> Derek Parnell wrote:
>>>>>>> Georg Wrede wrote:

>>>>>> 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?
>>>
>>> Could it be that I missunderstood you? By your kind of booleans did you mean the true non-integer booleans? If so, that is what the example dow there is for: showing why we need real bools.
>>>
>>> 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. :-)


>> bool foo = 55 && 5000;
> 
> Oh my God!


> Really I can't see yet why you don't like the pure bool. We should see an
> example of why pure bools would bother you so much.

In this post alone, there's a half dozen references to "my kind of bool" or "your kind of bool", by various people.

Probably somebody should start making a table of their properties! :-)

And if they don't, we could always examine this thread later, and I bet we could find one or two pairs of folks vehemently arguing, and it'd turn out "their bools were the same", only they didn't notice.
February 27, 2006
Georg Wrede wrote:
> Tom wrote:
> 
>> Georg Wrede says...
>>
>>> Ivan Senji wrote:
>>>
>>>> Georg Wrede wrote:
>>>>
>>>>> Ivan Senji wrote:
>>>>>
>>>>>> Georg Wrede wrote:
>>>>>>
>>>>>>> Derek Parnell wrote:
>>>>>>>
>>>>>>>> Georg Wrede wrote:
> 

This above looks cool.

> 
>>>>>>> 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?
>>>>
>>>>
>>>> Could it be that I missunderstood you? By your kind of booleans did you mean the true non-integer booleans? If so, that is what the example dow there is for: showing why we need real bools.
>>>>
>>>> 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. :-)
> 
> 
> 
>>> bool foo = 55 && 5000;
>>
>>
>> Oh my God!
> 
> 
> 
>> Really I can't see yet why you don't like the pure bool. We should see an
>> example of why pure bools would bother you so much.
> 
> 
> In this post alone, there's a half dozen references to "my kind of bool" or "your kind of bool", by various people.

Funny thread.

> 
> Probably somebody should start making a table of their properties! :-)
> 
> And if they don't, we could always examine this thread later, and I bet we could find one or two pairs of folks vehemently arguing, and it'd turn out "their bools were the same", only they didn't notice.

After all, what ever bizare variant of a bool gets implemented, it is still out D's bool :)
February 27, 2006
Ivan Senji wrote:
> Georg Wrede wrote:

> That is one part I didn't understand. Why would booleans have to be 0 or 1? (or are you kidding, I'm too tired to be sure).

Since anything stored on a computer is representable with numbers, then we could of course have true be 27 and false be 41.

But is there any profit in it, compared to 0 and 1?
February 27, 2006
Georg Wrede wrote:
> Ivan Senji wrote:
> 
>> Georg Wrede wrote:
> 
> 
>> That is one part I didn't understand. Why would booleans have to be 0 or 1? (or are you kidding, I'm too tired to be sure).
> 
> 
> Since anything stored on a computer is representable with numbers, then we could of course have true be 27 and false be 41.

Starting to like this proposal but I would prefer true to be 42 (being the answer to the universal question of everything)

> 
> But is there any profit in it, compared to 0 and 1?

Only the above.
February 27, 2006
On Mon, 27 Feb 2006 01:29:07 +0200, Georg Wrede wrote:

>> 
>> 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.

But D currently allows this to happen. It's boolean implementation is
broken.

>>   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.

Aren't you reading my posts anymore ;-)

  while(1)

is shorthand for

  while (1 != 0)

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

is shorthand for

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


-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocracy!"
27/02/2006 12:00:30 PM
February 27, 2006
Kyle Furlong wrote:
> Georg Wrede wrote:
> 
>>
>>
>> This is getting hilarious...


> Georg, reading your posts on this NG has given me great insight into the breadth of your knowledge and the depth of your wisdom. Your sarcasm is always poigniant and appropo. Your jibes at your fellow NG's always in good taste. And your blind cheerleading and bandwagoning the height of prudence and solid judgement. Keep up the good work!

Thanks!

Which reminds me, better go to bed before it gets too hilarious...

georg

PS, haven't had this much fun for a long time. I hope everyone else enjoyed it too!
February 27, 2006
In article <dttiq1$2q5g$1@digitaldaemon.com>, Ivan Senji says...
>
>Georg Wrede wrote:
>> Ivan Senji wrote:
>> 
>> Since anything stored on a computer is representable with numbers, then we could of course have true be 27 and false be 41.
>
>Starting to like this proposal but I would prefer true to be 42 (being the answer to the universal question of everything)
>

Ouch! And false must then be 54. (6*9) :P


February 27, 2006
In article <44025193.2060501@nospam.org>, Georg Wrede says...
>
>Kyle Furlong wrote:
>> Georg Wrede wrote:
>> 
>>>
>>>
>>> This is getting hilarious...
>
>
>> Georg, reading your posts on this NG has given me great insight into the breadth of your knowledge and the depth of your wisdom. Your sarcasm is always poigniant and appropo. Your jibes at your fellow NG's always in good taste. And your blind cheerleading and bandwagoning the height of prudence and solid judgement. Keep up the good work!
>
>Thanks!
>
>Which reminds me, better go to bed before it gets too hilarious...

Me too, have to work and study tomorrow, shouldn't have "wasted" so much time having fun with you guys.

>
>georg
>
>PS, haven't had this much fun for a long time. I hope everyone else enjoyed it too!

I almost can say that I feel appreciation for all people involved (it's unavoidable as you all seem to be nice guys). But remember, bool doesn't worth a bloodshed :P


Tom;
February 27, 2006
"Ivan Senji" <ivan.senji_REMOVE_@_THIS__gmail.com> wrote in message news:dttebh$2kqq$1@digitaldaemon.com...
>> Ever seen this:
>>
>> while(1)
>
> I sure did, and it scares the hell out of me :)

Why? This is a practice I got into with C/C++, and I did it because 1 cannot be redefined by the preprocessor into something goofy. I.e., I *knew* what it was without having to go spelunking through header files.