Short list with things to finish for D2

Bill Baxter wbaxter at gmail.com
Mon Nov 23 04:38:32 PST 2009


On Mon, Nov 23, 2009 at 3:12 AM, Don <nospam at nospam.com> wrote:

>> This sounds like a job for better mixin syntax.
>>.
>> So let "template#(args)" be equivalent to "mixin(template!(args))".
>>
>> Then you can do
>>
>> auto statement = db.execute#(`select $visitcars.name from table where
>> $visitcars.id > 100 && $visitcars.surname Like "A*"`);
>
> Yeah, something like that. Or it could mixin automatically. eg if
> macro foo(args...)
> foo(args) meant  mixin(foo(args)).

This is what I've been thinking too.
But we might want there to be more to a macro than that.  For instance
most macro parameters are strings and the '(string this, string that,
string theOther)', list of parameters doesn't look so great.  And
requiring the strings to be quoted on the calling side, also makes the
call side rather ugly.  It may be better to have arguments
automatically convert to some sort of AST type which supports some
introspection, and can be converted back to a string of code easily.

So I think jumping on just making macro mean "mixin automatically"
right now may limit our future choices too much.

--bb



More information about the Digitalmars-d mailing list