DMD 1.005 release
BLS
Killing_Zoe at web.de
Tue Feb 6 09:02:09 PST 2007
Pragma schrieb:
> BLS wrote:
>
>> I guess here is a need for further explaination.
>>
>> Either I am an complete idiot (not completely unrealistic) and
>> missunderstood something, or a new, quit radical, programming
>> paradigmn change is on it s way. I mean it is difficult to realize
>> the implications.
>> Bjoern
>
>
> Just try to wrap your head around this:
> http://www.digitalmars.com/d/mixin.html
>
> template GenStruct(char[] Name, char[] M1)
> {
> const char[] GenStruct = "struct " ~ Name ~ "{ int " ~ M1 ~ "; }";
> }
>
> mixin(GenStruct!("Foo", "bar"));
>
> //which generates:
>
> struct Foo { int bar; }
>
> In short this means that we can have *100%* arbitrary code generation at
> compile time, w/o need of a new grammar to support the capability.
>
Hi Eric,
I am able to read and understand the code. (not nessesarily the far
reaching implications)
But the generated code is still D. So what does it mean :
Walter Bright schrieb:
> The idea is to enable the creation of DSLs (Domain Specific Languages)
How ?
Bjoern
Post scriptum
I can imagine the following scenario : D Compiler is calling a
Translator, a modified Enki f.i. to translate a Domain Specific Language
into D ... strange
More information about the Digitalmars-d-announce
mailing list