Clay language

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Dec 30 13:54:33 PST 2010


On 12/30/10 3:36 PM, "Jérôme M. Berger" wrote:
> so wrote:
>> On Thu, 30 Dec 2010 21:15:30 +0200, Jérôme M. Berger<jeberger at free.fr>
>> wrote:
>>
>>> Andrei Alexandrescu wrote:
>>>> Many good examples do prove a ton though. Just off the top of my head:
>>>>
>>>> - complex numbers
>>>      Multiplication and division are different from each other and from
>>> addition and subtraction.
>>>
>>>> - checked integers
>>>> - checked floating point numbers
>>>> - ranged/constrained numbers
>>>      More or less the same case, so I'm not sure that they make three.
>>> Other than that agreed.
>>>
>>>> - big int
>>>> - big float
>>>> - matrices and vectors
>>>> - dimensional analysis (SI units)
>>>> - rational numbers
>>>> - fixed-point numbers
>>>      For all of those, multiplication and division are different from
>>> each other and from addition and subtraction.
>>>
>>>      So what your examples do is actually prove *Steven's* point: most
>>> of the time, the code is not shared between operators.
>>>
>>>          Jerome
>>
>> First, most of these don't even have a division operator defined in math.
>
> 	?? The only type in this list without a division operator is vector
> all the others have it.
>
>> Second, you prove Andrei's point, not the other way around, since it
>> makes the generic case easier, particular case harder.
>>
> 	I'm sorry? What do you call the "generic case" here? All this list
> shows is that each operator needs to be implemented individually
> anyway. Andrei's point was exactly the reverse: he claims that most
> operators can be implemented in groups which clearly isn't the case
> here.

Oh, not to mention opIndexXxx. In fact I remember that the breaking 
point for Walter (where he agreed to implement my design pronto) was the 
spectrum of having to define opIndexAddAssign etc. which effectively 
doubled the number of named operators AND is virtually ALWAYS 
implemented in a uniform manner.

So let's not forget that the new design not only does what the D1 design 
does (and better), it also does things that the old design didn't, and 
in a scalable manner.

Does this settle the argument?


Andrei


More information about the Digitalmars-d mailing list