Language change proposal

Chris Pressey cpressey@REDACTED
Thu Oct 23 03:01:15 CEST 2003


On Thu, 23 Oct 2003 01:03:23 +0200
Joachim Durchholz <joachim.durchholz@REDACTED> wrote:

> Chris Pressey wrote:
> > It's a good idea, but wouldn't it be easier to write code that works
> > on different versions if it was done with macros,  e.g.
> > [...]
> 
> Most definitely *no*.
> I have maintained C code that went like this; it was a nightmare. The 
> reason was that it offered too many opportunities for "clever writing"
> like this:
> 
> if (normal condition) {
>    ...
> #ifdef VERSION = xxx
>    ...
> } else {
>    ...
> #else
>    ...
> } else {
>    ...
> #endif
>    ...
> }

Well, you don't have to worry about that, since you can't write that
kind of code in Erlang.  -ifdef() and friends cannot appear inside a
function definition.

-Chris



More information about the erlang-questions mailing list