null references redux + Looney Tunes
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Sun Oct 4 14:28:47 PDT 2009
bearophile wrote:
> 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?
Quoting myself: please name five remarkable complex literals.
> 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){...
That's not opBool, it's opIf. Testing with if does not mean conversion
to bool and then testing the bool.
> 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.
I'd love to hear more about that. I've asked several times about it and
never got a clear answer. My feeling is that an obscure mathematician
burped during a conference in the 1960s and was overheard and
misunderstood by someone who spread the news that complex numbers must
be built-in, or else.
Andrei
More information about the Digitalmars-d
mailing list