D parsing

Timothee Cour thelastmammoth at gmail.com
Sun Nov 10 17:03:42 PST 2013


On Sun, Nov 10, 2013 at 3:37 PM, Andrei Alexandrescu <
SeeWebsiteForEmail at erdani.org> wrote:

> On 11/10/13 3:21 PM, Timon Gehr wrote:
>
>> On 11/10/2013 11:43 PM, Andrei Alexandrescu wrote:
>>
>>>
>>>> It seems we could even get rid of __FILE__,__LINE__,__MODULE__ with AST
>>>> macros.
>>>>
>>>
>>> This would be a very small advantage. The special variables hardly cause
>>> any trouble.
>>>
>>> Andrei
>>>
>>
>> The trouble is that there are too few of them to (efficiently) reflect
>> all the information about the calling context one may be interested in.
>> I don't see the point in adding them one after another in an
>> unprincipled ad-hoc fashion instead of actually thinking up a good API
>> coupled with some more expressive power.
>>
>
> But the API would add them in exactly the same rote manner. I really don't
> see an advantage here.


All else being equal, a library solution is always preferable; and it's
easily extensible unlike what we have.


> An argument for macros would have to do a lot more than "we don't need
> __FILE__ etc. anymore".


More use cases have already been provided in this thread and previously.
The fact that *one* language feature enables all of those is a very good
indication there'll be more use cases. Furthermore, writing AST macros
instead of mixins is cleaner in terms of introspection, refactoring tools,
etc.



>
>
> Andrei
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20131110/2273e610/attachment-0001.html>


More information about the Digitalmars-d mailing list