[erlang-questions] Where is the syntax error.

Richard A. O'Keefe ok@REDACTED
Fri Sep 25 04:14:28 CEST 2015


On 25/09/2015, at 12:45 am, Roelof Wobben <r.wobben@REDACTED> wrote:
> Now I want to test it in erl.
> But then I see this output:
> 
> time:elapsed_time(Answer = fun() -> io:format("Sucess") end. ).
> * 1: syntax error before: '.'
> 
> Can someone give me  a tip where the syntax errror is.

The error message says "before: '.'"
So look for dots.
I can see two of them.
                                                           v  v
time:elapsed_time(Answer = fun() -> io:format("Sucess") end. ).
                                                           ^  ^

So it has to be one of those places.
Hint:  when is it legal to have a full stop *inside* a
function definition?

PS: it's "Success", not "Sucess".





More information about the erlang-questions mailing list