Fully dynamic d by opDotExp overloading

Nick Sabalausky a at a.a
Fri Apr 17 22:09:21 PDT 2009


"Daniel Keep" <daniel.keep.lists at gmail.com> wrote in message 
news:gsbini$dga$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.
>
> So we have to write ALL templated code that calls member functions or
> accesses properties/fields like this?
>

No, only ones that absolutely need to work with dynamic classes. Which is 
neither all nor the majority. Though dynamic invokation can absolutely be 
useful at times, it is, and absolutely should remain, a fringe case.

> Because otherwise objects may as
> well not be able to do this, since it wouldn't play with any templates 
> ever.
>
> You have to be joking.
>

Joking about keeping my static guarantees? When the only other thing at 
stake is a little bit of syntactic sugar on some occasional dynamic code? 
Not a chance.





More information about the Digitalmars-d mailing list