Hi Robert,
Thank you for your detailed answer, and even preemptively answering some
of my potential followup questions.
A couple of thoughts:
> After this it
> is impossible to add or delete functions from a module without
> recompiling the *whole module*.
Specifically in the case of redefining functions, does this mean that
BEAM does not have enough - i.e. the compiled module and the function's
new definition and whatever other data it already keeps about the module
- to hypothetically automatically recompile and reload the whole module
itself?
As for my last question, in the absence of such feature - how close can
I get? I can see lots of references for performing releases and hot code
loading, but none for self-updating code. If we ignore external
dependencies, then "all" we'd have to do would be:
- keep module source code
- expose function/macro for replacing/adding/removing functions
- replace function definition with the new one in module source
- compile new source
- load new module
most of which can be done by importing macro(s), right? Am I missing
something? Has anything similar been done already?
Thank you.