[erlang-questions] what is the correct syntax to spawm a MFA with no arguments?
Thu May 1 19:13:38 CEST 2008
Really? Are you sure? Well, then describe us how long live running server
turning around one loop/x function can change code of loop when you don't
export loop/x function or some other function called from its loop. Just
On Thu, May 1, 2008 at 6:39 PM, Richard Carlsson <> wrote:
> Jarrod Roberson wrote:
> > so are you saying you can do hot code reloading _without_ using the MFA
> > version of spawn?
> Yes. If you spawn a process whose starting point is in the same module,
> you just use spawn(fun loop/0) or spawn(fun () -> loop(...) end). If you
> spawn a process that starts in _another_ module, you can write
> spawn(fun moo:loop()) or spawn(fun () -> moo:loop(...) end). Of course,
> in the latter case the function must be exported from moo, but you never
> need to export a function in the current module just because you want it
> to be the starting point of a process.
> I know that Joe's book (sadly) contains a remark that indicates that
> there is some problem with dynamic code loading and spawning from a fun,
> but that remark is just misleading.
> If you avoid exporting functions that shouldn't really be exported,
> tools like dialyzer can make a much better job of finding out what
> your program is doing (and tell you where you screw up).
> erlang-questions mailing list
--Hynek (Pichi) Vychodil
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions