DMD 0.148 release

Ivan Senji ivan.senji_REMOVE_ at _THIS__gmail.com
Sun Feb 26 14:53:43 PST 2006


Derek Parnell wrote:
> On Mon, 27 Feb 2006 02:43:56 +1100, Wang Zhen <nehzgnaw at gmail.com> wrote:
> 
>> Derek Parnell wrote:

>> 32-bit int is frequently used to implement the concept of integers, 
>> but  they are semantically different.
> 
> 
> I understood that a 32-bit int was used to implement a subset of 
> integers,  not the whole range.

And that is exactly the way I understand it, actually it *is* that way.

> 
>> So what? Be a language purist and refuse to call int an integer until  
>> programmers can store arbitrary integers without having to worry 
>> about  the implementation details?
> 
> 
> An 'int' *is* an integer. But an integer is not necessarily an 'int'. I  
> don't find this a difficult concept.

Very simple concept indeed.

> 
>>> It is quite possible for a language to implement falsehood/truth is  
>>> ways  other than using integers but even if they do, the compiler 
>>> can  still  ensure that the sematics are adhered to rather than 
>>> continue  using integer  sematics.
>>>  The only thing I can see wrong with D's new boolean is that it 
>>> still   pretends its a number. Why is this wrong? Because it can lead 
>>> to  coding  mistakes and abuse. Thus making maintenance more costly 
>>> than it  needed to  be.
>>
>>
>> Pretending that bool is not a number can possibly lead to more 
>> confusion  and misuse. Besides, many other features can also be abused 
>> in a  practical language like D. Abandon them all just in case some  
>> unconscious programmer might make a mistake?
> 
> 
> Who is pretending? I'm not. A boolean is not a number. If it was, you  
> should be able to arithmetic with it, but 'what is truth raised to the  
> power 4?' is nonsense.

Well you might say that it is true*true*true*true == true && true && 
true && true == true :)

But than I would expect operators + and * to behave like || and &&.
:)



More information about the Digitalmars-d-announce mailing list