Fully dynamic d by opDotExp overloading
Christopher Wright
dhasenan at gmail.com
Fri Apr 17 20:22:01 PDT 2009
Andrei Alexandrescu wrote:
> Christopher Wright wrote:
>> Andrei Alexandrescu wrote:
>>> Cool! I suggest the rewrite:
>>>
>>> c.unknownmethod(args) -> c.opDotExp!("unknownmethod")(args)
>>>
>>> That way you have the option of handling the method name statically
>>> or dynamically.
>>
>> How would that allow you to handle the method name dynamically, if
>> you're passing it as a template argument?
>>
>> You mean that the *callee* can be dynamic. However, the *caller* cannot.
>
> Of course. It makes no sense to ask for integrated syntax with a
> variable string. Think of it for a minute.
It standardizes a system for dynamic method dispatch with arguments
generated at runtime or compile time. For arguments generated at compile
time, it provides syntactic sugar.
Yours standardizes a system for dynamic method dispatch with arguments
generated at compile time, and provides syntactic sugar. It also
provides some minor opportunities for partial compile-time checking for
these arguments.
In the end, I think that standardization of the runtime portions isn't
so important. I accede.
More information about the Digitalmars-d
mailing list