[erlang-questions] function with no parameter?

Doug Edmunds dougedmunds@REDACTED
Wed Jun 18 21:09:52 CEST 2008


I doubt any of them work unless you prefix the function
with the name of the module (unless you are shadowing
a BIF, in which case you are really calling the BIF and
not yours.

the tipoff is 'undefined function'

try this:
whatever_the_module_name_is:hej().

which will work, as long as the module is in the
search path.

-dae

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/16ea7ed5/attachment.htm>


More information about the erlang-questions mailing list