[erlang-questions] function with no parameter?

David Mercer <>
Wed Jun 18 20:57:24 CEST 2008

You should prefix the function call with the module.  E.g., “Module:hej().”



[mailto:] On Behalf Of Circular Function
Sent: Wednesday, June 18, 2008 13:19
Subject: [erlang-questions] function with no parameter?


-export([hej/0,fib/1,fibx/1,fac/1, fac2/1, sq/1,cube/1,power/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?



Går det långsamt? Skaffa dig en snabbare bredbandsuppkoppling.
Sök <http://shopping.yahoo.se/c-100015813-bredband.html?partnerId=96914325>
och jämför hos Yahoo! Shopping.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080618/76d325f0/attachment.html>

More information about the erlang-questions mailing list