DMD 1.005 release
Yauheni Akhotnikau
eao197 at intervale.ru
Tue Feb 6 02:16:00 PST 2007
> The idea is to enable the creation of DSLs (Domain Specific Languages)
> that don't have the crippling problem C++ expression templates have -
> that of being stuck with C++ operators and precedence.
Not only that. This opens clean and simple way to use pre-compile-time
code generation. For example:
// greeting.d:
import std.stdio;
class Greeting
{
mixin( import( "greeting.impl.d" ) );
}
void
main()
{
auto g = new Greeting;
g.hello();
g.bye();
}
// greeting.impl.d:
void
hello()
{
writefln( "Hello!" );
}
void
bye()
{
writefln( "Bye!" );
}
Where the content of greeting.impl.d can be generated by some
domain-specific tool (such as ASN.1 serializator/deserializator
generators).
It's a very good news! Thanks!
--
Regards,
Yauheni Akhotnikau
More information about the Digitalmars-d-announce
mailing list