dynamic classes and duck typing

Simen kjaeraas simen.kjaras at gmail.com
Mon Nov 30 14:10:34 PST 2009


On Mon, 30 Nov 2009 23:02:46 +0100, Walter Bright  
<newshound1 at digitalmars.com> wrote:

> Simen kjaeraas wrote:
>> I'm already in love with this feature.
>
> So am I. It seems to be incredibly powerful.
>
> Looks to me you can do things like:
>
> 1. hook up to COM's IDispatch
>
> 2. create 'classes' at runtime
>
> 3. add methods to existing classes (monkey patching) that allow such  
> extensions
>
> 4. provide an easy way for users to add plugins to an app
>
> 5. the already mentioned "swizzler" functions that are generated at  
> runtime based on the name of the function

I know, and interfacing with scripting languages just got
even awesomer than it already was in D.

Oh, and another thing: Will we get property syntax for this?

I'd like to use this for shaders, allowing one to refer to
the shader's own variables directly from D, but currently I am
limited to function call syntax (unless I'm missing something?)

-- 
Simen



More information about the Digitalmars-d mailing list