I know this is a typical noob question, but I'm just getting into Erlang and can't seem to get it working correctly. I've written a simple factorial function that I want to display text with, but the compiler complains about syntax...any help would be appreciated!!
<br><br> -module(factorial).<br> -export([main/0]).<br><br> main() -><br> io:format("The factorial of 5 is: ").<br> fac(5).<br> <br> fac(X) -><br> if X == 1 -><br>
1;<br> else -><br> X * fac(X - 1)<br> end. <br> <br>The compile error I'm getting is:<br>21> c(factorial).<br>./factorial.erl:6: syntax error before: '.'<br>./factorial.erl:8: Warning: function fac/1 is unused
<br>error<br>