Temporarily disable all purity for debug prints

spir denis.spir at gmail.com
Tue Apr 12 01:12:17 PDT 2011


On 04/12/2011 04:05 AM, Nick Sabalausky wrote:
>> As more and more D2 functions become pure in my code and in Phobos,
>> >  something like a -disablepure compiler switch (and printf/writeln inside
>> >  debug{}) may allow more handy debugging with prints (if the purity is well
>> >  managed by the compiler then I think disabling the pure attributes doesn't
>> >  change the program output).
>> >
> That's a very good idea. I'm a huge fan of printf-debugging (comes from
> years of developing on platforms that didn't have a good readily-available
> debugger), so not being able to do that in pure functions would be a very
> critical roadblock for me for using purity. In fact, it's already been a
> royal PITA for CTFE.

Same for me. I'm a fan of printf debugging not because of lack of debuggers, 
rather because of their "heaviness" & lack of flexibility. Debug output is by 
me far more direct, quicker & lighter; and agile.

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list