Fully dynamic d by opDotExp overloading

Nick Sabalausky a at a.a
Fri Apr 17 13:48:39 PDT 2009


"Leandro Lucarella" <llucax at gmail.com> wrote in message 
news:20090417191634.GA15139 at homero.springfield.home...
> Steven Schveighoffer, el 17 de abril a las 11:27 me escribiste:
>>
>> Sure, but what is the reason to need dynamic methods?  I'm just trying to 
>> understand the usefulness of it.
>
> RPC is an example that comes into mind
>
> There is plenty of magic you can do with dynamic methods. Just try
> a dynamic language and see =)
>

But is there any that can't be done with a dispatch function?

Besides, as I see it, the opDotExp-style syntax for calling a dynamic method 
is more limited because unless you're using a scripting language, you can't 
do:

auto foo = new Foo();
char[] func = /* Get from user input */;
foo.func(); // Call function the user specified

But you can do that with either a dispatch method or a reflection API that 
supports invokation.





More information about the Digitalmars-d mailing list