<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 7, 2013 at 2:27 AM, Jacob Carlborg <span dir="ltr"><<a href="mailto:doob@me.com" target="_blank">doob@me.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 2013-11-06 23:48, Timothee Cour wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As I mentioned in my OT, this is what I already have implemented ("I've<br>
actually already implemented this feature via a mixin, and find it<br>
extremely useful, but ... "); and I did take care of proper escaping,<br>
etc. I am using it extensively, however the requirement for using a<br>
mixin makes things uglier than they should:<br>
<br>
* cryptic ctfe error msgs upon wrong variable names<br>
* mixin can't be used in UFCS chains; additional () nesting<br>
to the point that I only use it in cases where the alternative is uglier.<br>
* potentially more strain on ctfe<br>
* mixins in general should be used sparingly<br>
<br>
Sure we can use existing mixins to fill this need, but to me this is<br>
exactly the same as the situation with lambda literal syntax:<br>
<br>
a=>a*2<br>
instead of<br>
(a){return a*2;}<br>
<br>
or lazy parameters:<br>
void fun(lazy string a)<br>
vs:<br>
void fun(string delegate() a)<br>
<br>
A little of syntax sugar can provide huge benifits.<br>
It's use case would apply to all assert error messages, DSLs etc.<br>
</blockquote>
<br></div>
I agree with you, but I rather have a more general solution. That is, AST macros.<span class="HOEnZb"><font color="#888888"><br>
<br></font></span></blockquote><div><br></div><div>I would love to have AST macros too, but how do they help for the problem at hand? (eg use cases in OT + DSL). Like others mentioned, the feature is not crazy, it is present in most languages.</div>
<div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
-- <br>
/Jacob Carlborg<br>
</font></span></blockquote></div><br></div></div>