D parsing

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Nov 10 14:49:39 PST 2013


On 11/10/13 1:17 PM, Jacob Carlborg wrote:
> On 2013-11-10 21:38, Timothee Cour wrote:
>
>> I agree; eg, just to name 2 features that I proposed that could be
>> simply implemented via AST macros as Jacob said:
>> * [proposal: a new string litteral to embed variables in a string
>> <http://forum.dlang.org/post/mailman.94.1383254681.9546.digitalmars-d@puremagic.com>
>>
>> http://forum.dlang.org/post/mailman.94.1383254681.9546.digitalmars-d@puremagic.com]
>>
>> * [Re: feature request: __ARGS__ for logging (cf __FILE__, __LINE__,
>> __FUNC___ http://forum.dlang.org/post/kegmp0$30dn$1@digitalmars.com]
>>
>> It seems we could even get rid of __FILE__,__LINE__,__MODULE__ with AST
>> macros.
>
> Let see, what else. These could, most likely, have been implemented
> using AST macros:
>
> * scope
> * foreach
> * for
> * inlining delegates. I think the current solution to pass a
> delegate/lambda as an alias parameter is a bit weird
>
> One of my favorites that is not already in the language is implementing
> database queries:
>
> Person.where(e => e.name == "John");
>
> Will be translate to the following SQL:
>
> select * from person where name = 'John'
>
> Another one is the property shortcut, see the example for attribute
> macros: http://wiki.dlang.org/DIP50#Attribute_macros

The way I see this is, these preexisting features (which shan't be 
thrown away) diminish the motivation for adding another feature.

Andrei




More information about the Digitalmars-d mailing list