Anonymous function and rpc

Vlad Dumitrescu XX (LN/EAB) vlad.xx.dumitrescu@REDACTED
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: owner-erlang-questions@REDACTED 
> [mailto:owner-erlang-questions@REDACTED] On Behalf Of Jérôme Sautret
> Sent: Wednesday, May 24, 2006 11:44 AM
> To: erlang-questions@REDACTED
> Cc: jerome.sautret@REDACTED
> 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)
> (debug@REDACTED)1> rpc:call(debug2@REDACTED, mnesia, transaction,
> [fun() -> ok end]).
> {atomic,ok}
> (debug@REDACTED)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}]}}
> (debug@REDACTED)3> q().
> ok
> % cat mydebug.erl
> -module(mydebug).
> -export([mydebug/0]).
> 
> mydebug() ->
>    rpc:call(debug2@REDACTED, mnesia, transaction, [fun() -> ok end]).
> 
> % EOF
> %
> 
> Any hint welcome.
> Thanks,
> Jérôme.
> 



More information about the erlang-questions mailing list