Plot2kill 0.2

Nick Sabalausky a at a.a
Fri Mar 11 21:36:22 PST 2011


"Simon" <s.d.hammett at gmail.com> wrote in message 
news:ilec50$cj0$1 at digitalmars.com...
> On 11/03/2011 22:52, David Nadlinger wrote:
>> On 3/11/11 11:36 PM, Simon wrote:
>>> On 11/03/2011 21:33, Nick Sabalausky wrote:
>>>> Unfortunately that makes debugging CTFE a royal pain in the ass since
>>>> CTFE
>>>> has absolutely zero way to send anything to stdout - [.]
>>> [.]
>>> just use:
>>>
>>> pragma(msg, CTFE_string);
>>
>> No, this doesn't quite cut it for debugging CTFE functions: While you
>> can obviously use pragma(msg, .) to write the *result* of a function
>> invoked via CTFE to standard output, this doesn't help you if you want
>> to debug the stuff going on *in* that function itself, for example to
>> track down one of the numerous CTFE bugs.
>>
>> David
>>
>>
>> P.S.: As a last resort to get something printed during CTFE evaluation,
>> it is possible to use »assert(false, message)« - DMD prints the
>> (correctly evaluated) message as part of the compiler error message.
>> Obviously, this screws up compilation though.
>
> Never had a problem myself; and I've used some really hairy string mixins 
> to create runtime & CTFE functions.
> Worse case, when composing functions is to print out the result and copy 
> into a file and then debug as normal.
>
> It's neither elegant or convenient, but it works.
>

Yes. Like I said, it's a pain in the ass. I never said it wasn't possible.





More information about the Digitalmars-d-announce mailing list