null references redux + Looney Tunes

bearophile bearophileHUGS at lycos.com
Sun Oct 4 14:03:01 PDT 2009


Walter Bright:

> The 
> big reason for moving it to a library type is the user defined type 
> capabilities of D have grown to the point where there is no longer much 
> of any advantage to having it built in.

If the compiler/language is now flexible enough to allow the creation of a very good complex number, and the compilation time for such library numbers is good enough, and they get compiled efficiently enough, then removing them from the language is positive. But is the compiler now good enough to allow to implement very good complex numbers in the std lib?

One problem is to have a good syntax to define and use complex numbers. Time ago I have even suggested to keep the complex syntax in the compiler, and move the implementation in the std lib.

Another problem that I think is present still is the lack of a method like opBool, that gets called in implicit boolean situations like if(somecomplex){...

A third and more serious question is if the library complex type avoids the pitfalls discussed in the page about built-in complex numbers in the digitalmars site.

Bye,
bearophile



More information about the Digitalmars-d mailing list