Everyone needs a little debug() now and then. The RHTML statement <%=
debug(x) %> will barf out the value of x into the output page, inside
a tasteful grey DIV.
Suppose x were a complex expression. Or suppose (quell horror!) we
have several debugs, and they come and go.
Suppose I wanted debug() to also report the expression. debug(x + 1)
would emit x + 1: 43.
Rember the C and C++ preprocessors only deal with strings, so when you use
#define you're just doing some string substitution wherever the macro
appears in your >cough< code. The actual expressions are not evaluated until
later (ok, ok, some preprocessors are smart enough to fold simple invariant
expressions).
Does the above implementation of debug work for you?