On 08.08.2011 1:38, KennyTM~ wrote:
Pull request: https://github.com/D-Programming-Language/dmd/pull/296
Previous discussion:
http://www.digitalmars.com/d/archives/digitalmars/D/CTFE_writeln_140241.html
This is the 2nd try to add a compile-time printing facility to D. The
previous pull request uses std.stdio.writeln which causes some
concern, and then left unattended for a few weeks after the last
comment. So I go for my 2nd alternative, which is to add a magic
function __ctfeWriteln that does the same.
In my implementation, __ctfeWriteln will print the interpreted
arguments to stdmsg when CTFE-ed, and is a no-op in runtime (it can be
configured to throw an exception or actually print the arguments or
anything you like).
It's indeed a valuable built in, hopefully it'll get pulled, debugging
C-T vs R-T inconsistencies is quite a painful exercise ATM.
--
Dmitry Olshansky