PHP-style (embedded variables) print statements

Don Clugston dac at nospam.com.au
Thu May 31 23:28:31 PDT 2007


Witold Baryluk wrote:
> http://smp.if.uj.edu.pl/~baryluk/d/echo/echo.d
> http://smp.if.uj.edu.pl/~baryluk/d/echo/echo.html

We're obviously thinking the same way!
Yours is better presented than mine. I use a significant trick, though: the text 
which gets mixed in, contains a _second_ mixin. This allows the CTFE function to 
know the type of each variable, and its value if it is a compile-time constant. 
(although use of the value is currently incomplete, and disabled in the code I 
posted). Consequently, my version does not require RTTI (yours does, inside 
writefln). Feel free to steal ideas from it.






More information about the Digitalmars-d mailing list