dynamic classes and duck typing

Michel Fortin michel.fortin at michelf.com
Tue Dec 1 08:25:28 PST 2009


On 2009-12-01 07:01:20 -0500, Ary Borenszweig <ary at esperanto.org.ar> said:

> Foo foo = new Bar();
> foo.something();
> 
> will not work as expected because something() will be bound to Foo's 
> opDispatch and it isn't a virtual method. Of course you can make 
> opDispatch invoke a virtual function and override that function in Bar, 
> but since there isn't a standard name or method for doing this everyone 
> will start doing it their way (I don't like it when there's no 
> standarization for well-known operations) and it looks like a hack.

Someone ought to make std.dispatch and create that standardized runtime 
dispatch system.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list