Fully dynamic d by opDotExp overloading

Nick Sabalausky a at a.a
Fri Apr 17 22:01:12 PDT 2009


"Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message 
news:gsbjci$f6h$1 at digitalmars.com...
> Of course I agree. The thing is, if you decide to use a dynamic type, then 
> it will become like a dynamic type.
>

I didn't have a problem with that reasoning when Variant was added, because 
that was just one type. But now we're talking about opening D up to an 
entire class (no pun intended) of dynamic types. We've got an ointment 
factory and are now talking about adding a production line for flies and 
deliberately minimizing isolation. I use D because it's static, if we bring 
this level of dynamic-ism into it, then I won't be able to keep the flies 
out of my static ointment.


"Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message 
news:gsbjci$f6h$1 at digitalmars.com...
> Steven Schveighoffer wrote:
>>
>> I think Nick's point number 2 is that you would have to write the above 
>> as:
>>
>> void twix(T)(T value)
>> {
>>       value.invokeMethod("bar");
>>       value.invokeMethod("bar");
>> }
>>
>> which would work whether bar was dynamically or statically defined.
>
> And will uglify and pessimize all code for the benefit of the few.
>

Funny, that's very similar to my reasoning *against* allowing opDotExp. It 
undermines static typing expectations for the benefit of the few. It's very 
similar, but just on a smaller scale, to making declarations optional for 
the sake of those who don't like to use them.






More information about the Digitalmars-d mailing list