<div dir="ltr">Do you want to evaluate an expression at CT or to parse an expression?<div><br></div><div>D has a powerful constant-folding step during compilation, where whole functions can be evaluated, provided they contain only a subset of D (almost all of D, except taking adresses/pointers and generating classes, IIRC).</div>
<div><br></div><div><a href="http://en.wikipedia.org/wiki/Compile_time_function_execution">http://en.wikipedia.org/wiki/Compile_time_function_execution</a><br></div><div><a href="http://dlang.org/function.html#interpretation">http://dlang.org/function.html#interpretation</a><br>
</div><div><br></div><div><br></div><div>Now, if you want parsing specifically, what do you want to get? A parse tree? In that case, you can for example use one of my projects, Pegged, which generates CT-compatible parsers (that is, functions that can use CTFE to parse a string at CT).</div>
<div>Parse trees can also be manipulated at compile-time, to modify the expression, and then collapsed down again to a new expression, if that's what is needed.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
<a href="https://github.com/PhilippeSigaud/Pegged">https://github.com/PhilippeSigaud/Pegged</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>