DIP 50 - AST macros

Dmitry Olshansky dmitry.olsh at gmail.com
Wed Nov 13 12:07:54 PST 2013


13-Nov-2013 12:15, luka8088 пишет:
> On 10.11.2013. 22:20, Jacob Carlborg wrote:
[snip]
> foo {
>    writeln("foo");
>    writeln("foo again");
> }
>
> I would have to write:
>
> mixin(foo!(q{
>    writeln("foo");
>    writeln("foo again");
> }));
>

Actually even now it's can be just
foo!q{
  ...
};

For instance this is compilable:
{
  import std.regex;
  auto r =  ctRegex!"how do you think that works?";
}

See ctRegex template in std.regex.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list