[erlang-questions] Hot code loading and OTP

David Terrell <>
Fri Sep 21 18:12:34 CEST 2007


On Fri, Sep 21, 2007 at 08:19:56AM -0700, Jay Nelson wrote:
> A friend who hadn't seen erlang before just finished reading Joe's  
> book.  We were discussing hot code loading and he didn't realize that  
> prefixing a function call with a Module: caused a load of code from  
> disk.  I attempted to search through the book and find the  
> description, but was unable to find an explicit reference.  Was this  
> accidentally left out?

calling Module:Func only loads the module from disk if the module
was not loaded before.  It does not reload the module.

The only time there's a difference in behavior is the case of 
localfunc(Args) vs ?MODULE:localfunc(Args).  The former will
stay in the same version of the module; the latter will break
out of the stale version and into the new version if the module
has been reloaded.

-- 
David Terrell

((meatspace)) http://meat.net/



More information about the erlang-questions mailing list