Remove complex and imaginary types?

Robert Fraser fraserofthenight at gmail.com
Mon Jan 7 00:13:41 PST 2008


Walter Bright wrote:
> The issue comes up now and then about why have complex and imaginary 
> types, rather than using structs? All but one of the advantages of 
> having them be core types can be addressed with advancing compiler 
> technology. Getting rid of them will release 6 keywords, and make the 
> core language simpler. Given the increasing complexity of D, this will 
> help.
> 
> The remaining advantage is that of imaginary literals, i.e. the i postfix:
> 
>     3 + 5i
> 
> Assuming we solve the literal problem, existing code would only need to 
> add:
> 
>     import std.complex;
> 
> to acquire complex and imaginary types.

I never use them in the style of code I write, so I personally wouldn't 
miss them. I think for code that does need it, if (and only if) the same 
performance benefits can be seen in a struct, it will simplify the 
language enough to justify their removal.



More information about the Digitalmars-d mailing list