[erlang-questions] : Sending funs between nodes

Raimo Niskanen raimo+erlang-questions@REDACTED
Mon Sep 17 09:40:22 CEST 2007


Since the shell emulates expressions it does not compile funs
- it emulates them too. And that is done by having a bunch of
compiled shell funs; arity 0..20 something. These shell funs
take the real fun code to emulate in their environment.

So they look like funs, but are fun instances that emulate
the fun you defined in the shell.

That also means that they are compiled on all other nodes if just
the same version of the shell module is loaded on the other nodes.



On Fri, Sep 14, 2007 at 11:21:50PM +0400, Kirill Zaborski wrote:
> On 9/13/07, Gaspar Chilingarov <nm@REDACTED> wrote:
> >
> > there are 2 ways -- if you define fun inside module (like in your
> > example) fun is defined inside module at compile time and is passed
> > around as reference to some funcion in that module.
> >
> 
> But why are those ways different from each other? What's so special in
> constructing funs from shell and why can't I do the same from compiled
> module?
> 
> Best regards,
> Kirill.

> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list