[erlang-questions] funs and code loading

Dániel Szoboszlay dszoboszlay@REDACTED
Tue Jun 3 18:23:03 CEST 2014


Hi Fred,

I think we are talking about slightly different things here. I understand the concepts of old code and why shall a process executing the first version of the code be terminated when the third version is loaded.

But I don’t understand why holding a fun (but not executing the code!) is a reason for killing the process. Especially since I can hide the fun in an ets table and read it back from there after the code is gone. So the emulator doesn’t have a built-in constraint that every fun must point to existing (new or old) code.

This is not the same mechanism as executing old code either: executing a fun that points to no code raises a badfun error (which can be catched, if I wish).

Regards,
Daniel

On 2014 Jun 3, at 16:56 , Fred Hebert <mononcqc@REDACTED> wrote:

> On 06/03, Dániel Szoboszlay wrote:
>> My question is why’s the difference?
>> 
>> [...]
>> 
>> Could someone explain to me what is the VM doing here and why?
>> 
> 
> […]
> So what you see with anonymous functions here is the same mechanism,
> just repeated in a different way.
> […]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140603/32fbf1ee/attachment.htm>


More information about the erlang-questions mailing list