[erlang-questions] function with no parameter?

Rapsey rapsey@REDACTED
Wed Jun 18 21:06:16 CEST 2008


Are you sure you didn't forget to call the function with the module name?
module:hej().


2008/6/18 Circular Function <circularfunc@REDACTED>:

> -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?
>
> ------------------------------
> Går det långsamt? Skaffa dig en snabbare bredbandsuppkoppling.
> Sök och jämför hos Yahoo! Shopping.<http://shopping.yahoo.se/c-100015813-bredband.html?partnerId=96914325>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080618/ba9719eb/attachment.htm>


More information about the erlang-questions mailing list