www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: dynamic classes and duck typing

reply Alvaro Castro-Castilla <alvcastro yahoo.es> writes:
Walter Bright 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

Yes, this feature is really really useful. I specially like how much it can help in modularizing and your 3rd and 4th points. I added a dmd2 svn version ebuild to Gentoo Linux's D overlay, for those of you who want to try it before next release.
Nov 30 2009
parent reply Bill Baxter <wbaxter gmail.com> writes:
On Mon, Nov 30, 2009 at 3:20 PM, Alvaro Castro-Castilla
<alvcastro yahoo.es> wrote:
 Walter Bright 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: ... 5. the already mentioned "swizzler" functions that are generated at runtime based on the name of the function


And once again we see Clugston's Law at work. As soon as you figure out how to do one thing in D, a new compiler feature comes along that makes it a one-liner. :-) --bb
Nov 30 2009
next sibling parent Walter Bright <newshound1 digitalmars.com> writes:
Bill Baxter wrote:
 And once again we see Clugston's Law at work.  As soon as you figure
 out how to do one thing in D, a new compiler feature comes along that
 makes it a one-liner.  :-)

The goal is to write a D compiler in one line of code!
Nov 30 2009
prev sibling parent reply Don <nospam nospam.com> writes:
Bill Baxter wrote:
 On Mon, Nov 30, 2009 at 3:20 PM, Alvaro Castro-Castilla
 <alvcastro yahoo.es> wrote:
 Walter Bright Wrote:

 Simen kjaeraas wrote:
 I'm already in love with this feature.

Looks to me you can do things like: ... 5. the already mentioned "swizzler" functions that are generated at runtime based on the name of the function


And once again we see Clugston's Law at work. As soon as you figure out how to do one thing in D, a new compiler feature comes along that makes it a one-liner. :-)

I love it!
Dec 01 2009
parent Walter Bright <newshound1 digitalmars.com> writes:
Don wrote:
 Bill Baxter wrote:
 And once again we see Clugston's Law at work.  As soon as you figure
 out how to do one thing in D, a new compiler feature comes along that
 makes it a one-liner.  :-)

I love it!

Part of that is just that Don is very good at figuring out what needs to be supported!
Dec 01 2009