bug in pragma?

Jonathan M Davis jmdavisProg at gmx.com
Thu Jul 4 17:06:15 PDT 2013


On Friday, July 05, 2013 01:51:56 JS wrote:
> I think it's a logical flaw in D's CTFE system rather than some
> innate reason why it doesn't work.

The whole point of CTFE is to be able to call the same function at compile 
time that you call at runtime. Having a function work at compile time but not 
runtime would fundamentally break CTFE.

And it's _way_ easier to reason about what code is going to do if you 
understand the difference between stuff that's initialized at compile time (like 
an enum) and stuff which is run at compile time. Trying to mix the two would 
muddle things considerably.

In any case, I would shocked if Don thought that CTFE should work the way you 
think that it should work, and if you can't convince him, then odds are, 
you're out of luck. I'm just trying to explain to you how the language works 
and why what you're trying to do doesn't work.

- Jonathan m Davis


More information about the Digitalmars-d mailing list