On 04/09/2016 4:31 PM, Jonathan M Davis via Digitalmars-d wrote:
On Sunday, September 04, 2016 16:24:34 rikki cattermole via Digitalmars-d
wrote:
On 04/09/2016 4:14 PM, Stefan Koch wrote:
On Sunday, 4 September 2016 at 04:10:29 UTC, rikki cattermole wrote:
On 04/09/2016 2:08 PM, Stefan Koch wrote:
On Sunday, 4 September 2016 at 02:06:55 UTC, Stefan Koch wrote:
This works already.
Anything placed in a debug {} block will be considered pure regardless.

Opps your comment was about the debate.
I would say that __ctfeWriteln and __ctfeTicksMs should not work outside
of debug.

Can we have writeln and writefln call into it if __ctfe is true?
Just so that we have got some consistency between runtime and CTFE usage.

No!
writeln and __ctfeWriteln are to be regarded as completely different
things.
__ctfeWriteln is a debugging tool only!
It should not be used in any production code.

void writeln(T...)(T args) {
  if (__ctfe){
      debug {
          __ctfeWriteln(args);
      }
  } else {
      // ... current implementation
  }
}

Are you sureeeee?

He didn't say that it _couldn't_ be done. He said that it _shouldn't_ be
done.

- Jonathan M Davis

I wrote that code to prove that it could be used only for debugging purposes, which is Stefan's argument.

Reply via email to