[erlang-questions] First Erlang experiences- not so good
Thu Sep 25 06:34:45 CEST 2008
I've been going through this intro to Erlang
using the Windows version of the
Erlang (BEAM) emulator version 5.6.4 [smp:2] [async-threads:0]
For some reason, the example.erl file on the above site, will not compile.
I've contacted the autor and he verified the sources that can be
downloaded from the site still compile on his system, which is Linux.
I've even tried typing the few lines in example.erl into a new file
and compiling it, but still have the same problem- below
Eshell V5.6.4 (abort with ^G)
./example.erl:1: syntax error before: '-'
./example.erl:2: syntax error before: p
./example.erl:4: syntax error before: a
./example.erl:7: syntax error before: a
./example.erl:9: syntax error before: a
./example.erl:10: no module definition
Would someone shed some light on what a newbie is doing wrong?
Attached is the example.erl file I tried compiling.
Below are the lines from example.erl as well.
-export([fact/1, fact/2, call_with_five/1]).
fact(0) -> 1;
fact(N) -> N * fact(N-1).
fact(A,B) -> io:format("Chuck Norris kicks ~p people in ~p places ~n", [A,B]).
call_with_five(Func) -> Func(5).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 456 bytes
Desc: not available
More information about the erlang-questions