Anonymous function and rpc

Vlad Dumitrescu XX (LN/EAB) <>
Wed May 24 11:48:57 CEST 2006


Hi,

I think that you have to have the same version of mydebug installed on the remote host. The shell does some magic stuff under the covers :-)

/Vlad


> -----Original Message-----
> From:  
> [mailto:] On Behalf Of Jérôme Sautret
> Sent: Wednesday, May 24, 2006 11:44 AM
> To: 
> Cc: 
> Subject: Anonymous function and rpc
> 
> Hello all,
> 
> Is it possible to pass an anonymous function as a parameter 
> of a function called by rpc ?
> The strange thing is I can do it in the BEAM shell, but not 
> in a module :
> 
> % erl -sname debug
> Erlang (BEAM) emulator version 5.4.6 [source] [threads:0]
> 
> Eshell V5.4.6  (abort with ^G)
> ()1> rpc:call(, mnesia, transaction,
> [fun() -> ok end]).
> {atomic,ok}
> ()2> mydebug:mydebug().
> {aborted,{undef,[{#Fun<mydebug.0.39827269>,[]},
>                 {mnesia_tm,apply_fun,3},
>                 {mnesia_tm,execute_transaction,5},
>                 {rpc,'-handle_call/3-fun-0-',5}]}}
> ()3> q().
> ok
> % cat mydebug.erl
> -module(mydebug).
> -export([mydebug/0]).
> 
> mydebug() ->
>    rpc:call(, mnesia, transaction, [fun() -> ok end]).
> 
> % EOF
> %
> 
> Any hint welcome.
> Thanks,
> Jérôme.
> 



More information about the erlang-questions mailing list