[erlang-questions] Getting rid of the preprocessor

Max Bourinov <>
Thu May 24 13:44:28 CEST 2012


Hi Vlad,

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?

Best regards,
Max




On Thu, May 24, 2012 at 12:52 PM, Vlad Dumitrescu <>wrote:

> Hi,
>
> 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?
>
> <aside>
> 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.
> </aside>
>
> best regards,
> Vlad
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120524/83030d81/attachment.html>


More information about the erlang-questions mailing list