Short list with things to finish for D2

Steven Schveighoffer schveiguy at yahoo.com
Mon Nov 23 05:32:18 PST 2009


On Mon, 23 Nov 2009 07:38:32 -0500, Bill Baxter <wbaxter at gmail.com> wrote:

> 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.

What about this:

http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=17853

-Steve



More information about the Digitalmars-d mailing list