I was trying to do the following:<br>1) a module on node X -<br>-------------------<br>-module(test1).<br>-export([go/0]).<br><br>go() -><br>P = spawn(fun() -> receive X -> X() end end),<br>register(rrr, P).<br>-------------------
<br>2) a module on node Y -<br>-------------------<br>-module(test2).<br>-export([go/0]).<br><br>go() -><br>{rrr, x@LOKI}!fun() -> io:format("bar",[]) end.<br>-------------------<br><br>LOKI is my hostname :)
<br><br>So If I run test1:go() and then test2:go() on other node I get<br><br>=ERROR REPORT==== 29-Aug-2007::22:34:29 ===<br>Error in process <0.35.0> on node 'y@LOKI' with exit value: {undef,[{shell_defau<br>
lt,fun_to_list,[#Fun<erl_eval.20.62269157>]},{erl_eval,do_apply,5},{shell,exprs,<br>6},{shell,eval_loop,3}]}<br><br>** exited: {undef,[{shell_default,fun_to_list,[#Fun<erl_eval.20.62269157>]},<br> {erl_eval,do_apply,5},
<br> {shell,exprs,6},<br> {shell,eval_loop,3}]} **<br><br>It looks like fun needs code of the module where it was defined. Why is it so?<br>is there any way around this issue? Or I need the same beams on all the nodes?
<br><br><br>Best regards,<br>Kirill Zaborski.<br>