[erlang-questions] parameterized module returns badfun

Filippo Pacini <>
Fri Oct 5 09:30:33 CEST 2007


Hi,
I had a similar problem with parametrized modules in erlhive.

Ulf pointed me here:
http://www.erlang.org/pipermail/erlang-questions/2007-July/027672.html

There's a patch to apply to shell.erl without it parameterized modules
don't work on 5.5.5.

cheers,
filippo

YC wrote:
> Hi -
> 
> I tried out the parameterized module example in
> http://www.erlang.org/pipermail/erlang-questions/2007-May/026867.html -
> I can compile the example and even create the module instance, but
> evaluating the functions returns badfun instead.  I'm not sure where the
> issues are - any pointers are appreciated.  I'm using 5.5.5 on linux.
> 
> Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [hipe]
> [kernel-poll:false]
> 
> Eshell V5.5.5  (abort with ^G)
> 1> c(pmod).
> {ok,pmod}
> 2> M = pmod:new(3,4).
> {pmod,3,4}
> 3> M:sum().
> 
> =ERROR REPORT==== 2-Oct-2007::10:04:26 ===
> Error in process <0.30.0> with exit value:
> {{badfun,{{pmod,3,4},sum}},[{shell,apply_fun,3},{shell,exprs,6},{shell,eval_loop,3}]}
> 
> 
> ** exited: {{badfun,{{pmod,3,4},sum}},
>             [{shell,apply_fun,3},{shell,exprs,6},{shell,eval_loop,3}]} **
> 4> M:new_Y(5).
> 
> =ERROR REPORT==== 2-Oct-2007::10:09:13 ===
> Error in process <0.38.0 > with exit value:
> {{badfun,{{pmod,3,4},new_Y}},[{shell,apply_fun,3},{shell,exprs,6},{shell,eval_loop,3}]}
> 
> ** exited: {{badfun,{{pmod,3,4},new_Y}},
>             [{shell,apply_fun,3},{shell,exprs,6},{shell,eval_loop,3}]} **
> 5>
> 
> Thanks,
> yc
> 




More information about the erlang-questions mailing list