[erlang-questions] Getting rid of the preprocessor
Thu May 24 13:44:28 CEST 2012
I have relatively big OTP system. I use macros. I don't have any problems
you described. What I do wrong?
I don't debug my code because I think debugging is bad. I do unit tests and
ct tests. If after those tests there is a need for debug - my tests are
bad. I do better tests. Will this approach work for you too?
On Thu, May 24, 2012 at 12:52 PM, Vlad Dumitrescu <>wrote:
> There have been discussions now and then about the preprocessor and
> how it would be better to get rid of it. As someone that has to parse
> and handle source files before they are preprocessed, I am very much
> affected by it -- with macros that can be anything, an raw Erlang file
> can look like pretty much anything. Even if the macros are in practice
> mostly well-behaved, using them as alternatives to inlining code
> creates problem when debugging, for example, because you can't step
> through a macro invocation.
> One of the main reasons that was presented for not being able to
> replace the preprocessor with something that works at the lexical
> level is that records would need to be first made first-class citizens
> (as frames or whatever). I don't understand why that is -- the
> preprocessor doesn't do anything with records, their expansion is done
> later, by the compiler. Could someone comment on that, please?
> Is this issue a "definitely no-no" for OTP, or would it be considered
> if we can come up with a solution that doesn't break anything?
> Stepping through the code in the debugger is being thwarted even by
> the use of parse transforms. This could be handled by letting the
> debugger reconstruct the source it shows from the parsed
> representation and not from the source file.
> best regards,
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions