| Thread overview | |||||||
|---|---|---|---|---|---|---|---|
|
November 30, 2009 Re: dynamic classes and duck typing | ||||
|---|---|---|---|---|
| ||||
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.
| ||||
December 01, 2009 Re: dynamic classes and duck typing | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Alvaro Castro-Castilla | 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
| |||
December 01, 2009 Re: dynamic classes and duck typing | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | 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!
| |||
December 01, 2009 Re: dynamic classes and duck typing | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | 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.
>>> 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. :-)
I love it!
| |||
December 01, 2009 Re: dynamic classes and duck typing | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Don | 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!
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply