[erlang-questions] how to dynamically create function to run in a different node

Dror Mein drormein@REDACTED
Wed Jan 28 17:00:41 CET 2015


thanks Ulf for the help,
just to rap things up, what I ended up doing was this:http://stackoverflow.com/questions/2008777/convert-a-string-into-a-fun

which If I understand is based on the same data types you told me about.Seeing the way a token and exprs of fun looks is very enlightening
 

     On Thursday, January 1, 2015 11:15 PM, Ulf Wiger <ulf@REDACTED> wrote:
   

 

On 31 Dec 2014, at 18:49, Dror Mein <drormein@REDACTED> wrote:
Thank you!
so parse_transform is responsible of returning {M,F,A} where A is something I don't yet understand :).is there a way to turn {M,F,A} to fun?

Well, if you want to dispatch it to another node, using a (compiled) fun is problematic. This is the main reason why I used {erl_eval, exprs, [Exprs, Bindings]}.


Is there a simpler way to create a fun that can be run on a different node?

A fun can be run on a different node if the module it was compiled in has a compatible version (it doesn’t have to be the exact same version).
BR,Ulf W
Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.http://feuerlabs.com




   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150128/06656f63/attachment.htm>


More information about the erlang-questions mailing list