DMD 0.148 release

Georg Wrede georg at nospam.org
Sun Feb 26 14:26:50 PST 2006


James Dunne wrote:
> Derek Parnell wrote:
> 
>> On Mon, 27 Feb 2006 00:02:08 +1100, Georg Wrede <georg at nospam.org> wrote:
>>
>>> Derek Parnell wrote:
>>>
>>>> Walter is still living in the C/C++ past with this concept, which 
>>>> is   strange seeing he has implemented so many progressive concepts 
>>>> in D.   Boolean as an integer is just retro.
>>>
>>>
>>>
>>> So am I.
>>
>>
>>
>> Apparently so.
>>
>>> Booleans have to be int.
>>
>>
>>
>> Why? And do you mean they have to be implemented using 'int' or are 
>> you  saying that they are intrinsically integers?
>>
>>> A boolean may have any "numeric" value, but if   implicitly cast to 
>>> a  numeric type, it should return 1 or 0.
>>
>>
>>
>> Why?
>>
>>> D IS A PRACTICAL PROGRAMMING LANGUAGE.
>>
>>
>>
>> Which means what, exactly? For example, does the term 'practical' 
>> also  embrace the concept of 'cost-effective to maintain'?
>>
>>> Forcing booleans to be 1/0 all the way is just academic, purist,  
>>> impractical bigotry. About as smart as having the bit type.
>>
>>
>>
>> No one is saying that booleans must be forced to be 1/0? Why did you 
>> think  that this was what I was saying?
>>
>>> (Besides, if booleans, as some say here, are _only_ abstract 
>>> concepts,  then we might as well decide to have 0 mean true and 1 
>>> mean false.
>>
>>
>>
>> Exactly! The implementation is not the concept. Of course, this would 
>> not  be a very efficient implementation but it is a possiblity.
>>
>>> Heh, there's only one truth but millions of lies! But we live in a 
>>> world  with other people. And computers.)
>>
>>
>>
>> Did you just say that there is one 'zero' but millions of 'ones'?
>>
> 
> I actually laughed out loud at that.  Good catch man.  This is why I 
> love this NG. :)

So did I. At myself.

Of course, I meant to write "decide to have 0 mean true and anything 
else mean false -- only one truth but millions of lies".

>>> Now, specifying 0 to mean false and everything else to mean 
>>> not-false,  we go along with the hardware, the computer industry, 
>>> half a century of  programming PRACTICE, and make life less difficult 
>>> for anybody with a  professional programming background before moving 
>>> to D.
>>
>>
>>
>> And that's why it is a more efficient implementation. I agree that 
>> this is  how booleans will probably be implemented. But there are 
>> other sematics  that go with numbers that do not belong in the domain 
>> of booleans.
>>
> 
> 



More information about the Digitalmars-d-announce mailing list