[erlang-questions] One sample program want to know how it works

Ulf Wiger ulf@REDACTED
Sun May 18 15:16:46 CEST 2008


2008/5/18 Zvi <exta7@REDACTED>:
>
> what's confusing here is that, as a programmer, you expect following format
> for define preprocessor directive:
>
> -define(NAME, VALUE).
>
> Note the closing parenthesis ")" before the dot "."

For the benefit of newcomers, the program being discussed /was/
the winner of the Obfuscated Erlang Competition, so as such, it is
not so surprising that it's difficult to understand - that was the very
purpose of the program.

But sure, making use of the fact that macro definitions can be
syntactically incomplete, and furthermore the fact that the closing
parenthesis is optional, is highly discouraged in all programs not
especially written for the purpose of obfuscation.  (:

BR,
Ulf W



More information about the erlang-questions mailing list