[erlang-questions] exception error: an error occurred when evaluating an arithmetic expression
Richard A. O'Keefe
Wed Feb 11 04:39:02 CET 2015
On 11/02/2015, at 8:35 am, Roelof Wobben <r.wobben@REDACTED> wrote:
> I have this code :
> display(Number) when Number > 0 ->
> display_acc(0,Acc) ->
> display_acc(Number, Acc) ->
> display_acc(Number -1, [Number | Acc]).
> but as soon as I compile it, I see this message :
> ** exception error: an error occurred when evaluating an arithmetic expression
> in operator -/2
> called as side - effects
> What does that error exactly mean and how can I solve the code so I can make it work ?
The system told you exactly what happened.
For some reason, the compiler tried to evaluate side - effects.
Where is that in your code?
Oh ho! You called your module side-effects with a hyphen/minus
instead of side_effects with an underscore.
I don't even want to try to imagine why the compiler might try to
evaluate the module name as an expression.
More information about the erlang-questions