How can I dump an expression into log and execute it

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 13 05:33:20 PDT 2014


On 07/13/2014 12:45 PM, Dicebot wrote:
> On Sunday, 13 July 2014 at 10:19:26 UTC, Jacob Carlborg wrote:
>> On 2014-07-12 01:02, Dicebot wrote:
>>
>>> Whatever is ideal solution, we better focus on something practical that
>>> can be realistically added to the language within current priorities
>>> (stability, minimizing addition of new features, clearing corner cases
>>> etc.)
>>
>> Funny thing you should mention "minimizing addition of new features".
>> That's exactly what AST macros are for. Just the recent addition of
>> supporting C++ namespaces could have easily been implemented with AST
>> macros.
>
> Yes I know and likely would have preferred that approach if we were
> speaking about designing brand new language. But right now we already
> have string mixins

They are not a great liability. They are a simple feature. They take up 
less than 200 lines of code in my D frontend implementation, _together_ 
with template mixins.

> and those won't ever be deprecated -> any new code
> generation feature should be built on top of either those or template
> mixins.

That does not follow. In any case Jacob's macros are a code _reflection_ 
feature and a _hygienic_ code generation feature.


More information about the Digitalmars-d mailing list