<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 11, 2013 at 2:55 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-11 11:39, Timothee Cour wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
yes, I think your initial example becomes more interesting with this, as<br>
in its current form it can already be done in current D.<br>
</blockquote>
<br></div>
The current example prints out the exact expression what was passed to the assert macro. Not the result of evaluating the expression. I don't see how this can currently be done in D</blockquote><div><br></div><div>I'm using a modified assert that uses the ugly import(file)[line] trick, so that can be done (but is really ugly and has impact either runtime or compile time). But we're essentially in agreement.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This would make error messages self-documenting:<br>
<br>
myAssert(!file.exists );<br>
// "!file. exists" failed: dump of AST:<br>
file: string ="foobar.d"<br>
|_file.exists: bool = false<br>
   |_!file. exists: bool = false<br>
<br>
In many cases, this would be so much more useful than an out of date /<br>
incomplete string error message, esp w a lot of variables involved.<br>
</blockquote>
<br></div>
I agree.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
/Jacob Carlborg<br>
</font></span></blockquote></div><br></div></div>