[erlang-questions] macro - newbie question

Hasan Veldstra <>
Wed Apr 2 17:58:19 CEST 2008


> -define(OP_NAME(OpId),
>         if
> ...............
> ...............
>         end).
> 
> 
> when I try to compile the  i get an error
> ./trial.erl:7: syntax error before: 'end'
> ./trial.erl:3: function getval/1 undefined
> 
> Please let me know how I should use macros in this way.

There's a syntax error somewhere between 'if' and 'end' in your macro 
definition, can't tell more without the source. Quite likely to be a 
misplaced semi-colon though...



More information about the erlang-questions mailing list