Why is complex being deprecated again?

Don Clugston dac at nospam.com
Mon Apr 16 02:21:50 PDT 2012


On 15/04/12 06:20, Andrei Alexandrescu wrote:
> On 4/14/12 10:10 PM, Mehrdad wrote:
>> Why is complex being phased out?
>> What happened to all this? http://dlang.org/cppcomplex.html
>
> I don't think that page makes a compelling argument, but I'm not an
> expert. If Walter and Don agree, I'd remove the page.
>
> Andrei


I agree, I think that page should be killed.

The efficiency argument is valid but reduces to this: The complier 
*MUST* be able to generate equally good from a library type, as from a 
built-in language type.
Once we've reached that point, we can remove the built-in type.

The correctness issue is a good argument for implementing complex 
functions correctly (basically, you should do your branch cuts on the 
negative real axis, whenever possible). But to go from there to 
requiring that the language has a pure imaginary type is not convincing.

We don't have a 'negint' type for negative integers, why have a pure 
imaginary type?



More information about the Digitalmars-d mailing list