debug()

Jason House jason.james.house at gmail.com
Tue Feb 26 15:56:24 PST 2008


Orion- wrote:
> So, here are my 2 questions:
> 
>   * How do you know 'self' inside a class member function in D?

Use 'this'


>   * How would you do to have __LINE__ being the line where dprintf was
>   called not the line where it is implemented ?

I can't answer that part authoritatively, but...

Are you doing dprintf(...) instead of debug printf(...) ?  If so, I
recommend trying out the d style.  Using debug(n), where n is an int, can
be very useful for looking at differing levels of output.  I personally
have mostly moved away from that and started using debug(ident) (possibly
with debug=ident at the top of the file or adding -debug=ident to the dmd
call).  The nice thing with that is it becomes extremely easy to leave all
your debug stuff in your source.  When chasing down a bug later on, it can
be helpful.



More information about the Digitalmars-d mailing list