Simple question??

Ish Rattan ishwar@REDACTED
Tue Feb 16 23:36:35 CET 2010


The follwoing modules:

-module(t1).
-export([print_it/1]).

print_it(N) ->
    Fac = fac(N),
    io:format("fac of ~p is ~p~n", [N, Fac]).

fac(1) -> 1;
fac(N) -> N*fac(N-1).

when executed as:
   t1:print_it(5).
produces:
** exception error: undefined function t1:prin_it/1

What is the reason?

-ishwar



More information about the erlang-questions mailing list