[erlang-questions] Execute module code from stored anonymous function

Nuku Ameyibor <>
Sun Sep 11 09:27:33 CEST 2016


thanks for quick reply .
will give it a shot .

On Sun, Sep 11, 2016 at 7:08 AM, Dmytro Lytovchenko <
> wrote:

> In your case the pointer to function is stored internally and it goes
> extinct when module is gone.
> If you make it calculate function at runtime by, say, calling
> apply(mprocess, process_template, [test]), then it should work.
>
> sön 11 sep. 2016 kl 08:57 skrev Nuku Ameyibor <>:
>
>> Dear List ,
>>
>> i run into an issue where i was storing an anonymous function in mnesia
>> to be executed later .
>> *F=fun(test) ->mprocess:process_template(test)end.*
>>
>>
>> however  as soon as i make some changes to the mprocess module  and
>> upgrade the module i get a *** exception error: bad function* error when
>> i retrieve the fun and try to execute which i assume is because of the
>> difference in the module versions .
>> Is there a way of making the stored fun execute the code and not have
>> version conflicts .
>>
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160911/edd5534d/attachment.html>


More information about the erlang-questions mailing list