[erlang-questions] question: macro definition
Tue Jan 15 15:05:06 CET 2008
Macros don't work like erlang functions, they don't have arity so
LOG/1 and LOG/2 are same macro LOG.
On 1/15/08, Ahmed Ali <ahmed.nawras@REDACTED> wrote:
> I have a question about macro definitions in Erlang.
> When I write the following in my .hrl file:
> [line 10] -define(LOG(X), io:format("~w~n",[X])).
> [line 11] -define(LOG(X,D), io:format("~w~n",[X,D])).
> I get the following compile error:
> ./../include/file.hrl:11: redefining macro ''LOG''
> Can someone explain to me what "redefining" means here? Does that mean if I
> cannot define a macro with the same name even though they have different
> Best regards,
> Ahmed Al-Issaei
> erlang-questions mailing list
--Hynek (Pichi) Vychodil
More information about the erlang-questions