New syntax for string mixins

Graham St Jack Graham.StJack at internode.on.net
Tue Dec 14 03:42:23 PST 2010


On 14/12/10 20:33, Vladimir Panteleev wrote:
> On Tue, 14 Dec 2010 09:30:46 +0200, Graham St Jack
> <Graham.StJack at internode.on.net> wrote:
>
>> There is of course the worry that it could get so easy that everyone
>> starts doing it, and we have (relatively) impenetrable code everywhere
>> instead of just deep in the bowels of framework libraries.
>
> TBH, I'm more excited by AST macros which I understood are planned for
> D3, as mentioned here:
> http://s3.amazonaws.com/dconf2007/WalterAndrei.pdf
> They seem to promise the power of mixins, but without the mess.
>

I took a look at the pdf, but couldn't see how the AST macros could come
close to the kinds of things that are possible (but difficult) with 
mixins. Is there more information somewhere?

Jacob, I can see how your proposed syntax would make simple mixins 
easier and clearer, but how would it do something more complex?

For example taking a classname and a bunch of field types and names, and 
turning it into a class definition complete with constructor from field 
values, constructor from an input stream, a method to write to an output 
stream, and const getters. Or maybe std.typecons.AutoImplement.


-- 
Graham St Jack


More information about the Digitalmars-d mailing list