[erlang-patches] [erts, stdlib] fix escript/primary archive reloading

Håkan Mattsson <>
Thu Oct 6 10:44:00 CEST 2011

2011/10/6 Tuncer Ayaz <>

> 2011/10/6 Håkan Mattsson <>:
> > I do not like that erl_prim_loader has knowledge of escript
> > internals. Much of the "new" code is copied from escript.
> >
> > It would be better if the caller to set_primary_archive/3 could give
> > a fun or MFA as argument which can be executed when the archive
> > needs to be re-opened. Then we would avoid this duplication of code.
> Shouldn't the modules in erts/preloaded avoid using modules from lib?

Yes, but my suggestion does not introduce such a dependency.
erl_prim_loader will just apply a fun (or MFA) that it gets as
argument. There is no hard dependencies in the "wrong" direction.

Compare it with how the lists module works. The lists module
applies funs from other applications but does not dependent on them.

> What about sharing the code in a new module like
> erts/preloaded/src/prim_escript.erl?

It seems unneccessary. What would the purpose be?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20111006/f29f3b0c/attachment.html>

More information about the erlang-patches mailing list