DMD 1.005 release
Yauheni Akhotnikau
eao197 at intervale.ru
Wed Feb 7 23:17:38 PST 2007
On Thu, 08 Feb 2007 10:06:04 +0300, Walter Bright
<newshound at digitalmars.com> wrote:
> Yauheni Akhotnikau wrote:
>>> The main difficulty is if the DSL needs to access symbols in the rest
>>> of the D code.
>> I agree.
>> But how do you think do such things in the current approach?
>
> int i = 4;
> mixin("writefln(i)");
>
> will print:
>
> 4
I understand that :)
But suppouse than string "writefln(i)" has been produced by some DSL
transformator:
int i = 4;
mixin( ProduceWritefln("i") );
The content of ProduceWritefln() need no access to variable i -- it makes
some string which transformed to D code only in mixin(), not in
ProduceWritefln. So the main task of ProduceWritefln is manipulating of
string without access to any existed D code.
So my point is to allow to ProduceWritefln be ordinary D code which
executed at compilation time.
--
Regards,
Yauheni Akhotnikau
More information about the Digitalmars-d-announce
mailing list