Error reported when using pmap

Per Hedeland <>
Thu Aug 31 09:52:33 CEST 2006


Arbow <> wrote:
>
>      I am new in Erlang, and try the pmap at
>http://www.erlang.org/ml-archive/erlang-questions/200606/msg00187.html:
[snip]
>In file testmain.erl:
>-module(testmain).
>-export([test3/0]).
>
>test3() ->
>    MyList = [1,2,3,4,5,6,7,8,9,10],
>    lists:map(fun(I) -> I*2 end, MyList).
>
>when I execute " testmain:test3(). ", I get errors:
>
>=ERROR REPORT==== 30-Aug-2006::16:21:51 ===
>Error in process <0.36.0> on node '' with exit value:
>{undef,[{testmain,test3,[]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]}
>
>** exited: {undef,[{testmain,test3,[]},
>                   {erl_eval,do_apply,5},
>                   {shell,exprs,6},
>                   {shell,eval_loop,3}]} **
>
>Anyone could help me? Thanks.

As others have shown, there is nothing with the code that would explain
the error - did you actually compile it? How? FYI, 'undef' means that
the system couldn't find the definition of the testmain:test3/0 function
- this can have a couple of reasons:

- The 'testmain' module wasn't found, neither already loaded nor in a
  location in the file system where the system would look for modules to
  load.

- The 'testmain' module *was* found, but it didn't have a (exported)
  definition of test3/0.

The latter could possibly apply in your case if an older version of
'testmain' was already loaded, and you compiled the current one in a way
that didn't also load it - hence the questions above.

--Per Hedeland



More information about the erlang-questions mailing list