dynamic classes and duck typing

Don nospam at nospam.com
Tue Dec 1 11:43:34 PST 2009


Bill Baxter wrote:
> On Tue, Dec 1, 2009 at 5:18 AM, Lutger <lutger.blijdestijn at gmail.com> wrote:
>> Ary Borenszweig wrote:

>>>>>>> The feature isn't very dynamic since the dispatch rules are defined
>>>>>>> statically. The only thing you can do is rewire the associative

>> I don't get it, what if WhatTypeToPutHere does a dynamic lookup, then it's
>> pretty much the same a Javascript isn't it? Except that everything in
>> Javascript does dynamic lookup and in D you are restricted to types that
>> have this dynamic lookup (which, pending a phobos solution you have to code
>> yourself). Do you mean to say this 'except' is the obstacle somehow?
>>

>> How is that less dynamic? You would be able to call or even redefine at
>> runtime, for example, signals defined in xml files used to build gui
>> components.
> 
> It is a bit less dynamic because in D it's all done with templates.

It's a helluva lot more dynamic in D because it can do code generation 
on request. The "dynamic" bit in Javascript is really an AA lookup, + 
reflection.



More information about the Digitalmars-d mailing list