DMD 1.005 release
Pragma
ericanderton at yahoo.removeme.com
Tue Feb 6 07:57:46 PST 2007
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.
--
- EricAnderton at yahoo
More information about the Digitalmars-d-announce
mailing list