[erlang-questions] function with no parameter?

Circular Function <>
Wed Jun 18 20:19:17 CEST 2008


-export([hej/0,fib/1,fibx/1,fac/1, fac2/1, sq/1,cube/1,power/2, powerc/2,nCk/2]).

hej() -> 12.

this compiles but it doesnt work when calling in the shell.

36> hej(). 
** exception error: undefined function shell_default:hej/0

does this have anything to do with functions should be pure in erlang thus calling a fucntion with no parameter isnt allowed? but then why is creating them allowed?



      ___________________________________________________
Sök efter kärleken!
Hitta din tvillingsjäl på Yahoo! Dejting: http://ad.doubleclick.net/clk;185753627;24584539;x?http://se.meetic.yahoo.net/index.php?mtcmk=148783
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080618/7ad54c05/attachment.html>


More information about the erlang-questions mailing list