[erlang-questions] funs and code loading

Attila Babo babo.online@REDACTED
Mon Jan 21 19:40:21 CET 2008


On Jan 17, 2008 2:08 AM, Matthias Lang <matthias@REDACTED> wrote:
> for the record: I think your explanation is confusing and wrong.
You are absolutely right, I reviewed my explanation, this is simply a
bug what your patch fixes nicely. Just for record, if you switch code
during sleep this code will happily use new versions for F() and G(),
while f() and g() are intact.

	F = fun f/0,
	G = fun() -> f() end,
	io:fwrite("l: ~p ~p ~p ~p~n", [f(), g(), F(), G()]),
	timer:sleep(60000),
	io:fwrite("l: ~p ~p ~p ~p~n", [f(), g(), F(), G()]),

Thanks for the clarification!
Attila



More information about the erlang-questions mailing list