erlang:hibernate/1 with funs?

Bjorn Gustavsson <>
Tue Aug 17 10:07:55 CEST 2004

You call hibernate/3 like this to give it a fun:

  hibernate(erlang, apply, [F, []]).

We'll probably add an hibernate/1 function in R10B implemented
like this in erlang.erl.

The only disadvantage of using funs is if you do hot code replacement;
OTP has no built-in support for replacing code referenced by a fun.


Peter-Henry Mander <> writes:

> Hi gurus,
> After being informed of erlang:hibernate/3, I wonder if there's a
> erlang:hibernate/1, similar in style to erlang:spawn_link/1 which takes
> a fun argument? I prefer using funs which helps avoid exporting what I
> consider to be internal module functions when spawning.
> Is there a drawback writing code with spawn_link/1?
> Pete.
> -- 
> "The Tao of Programming
>  flows far away 
>  and returns 
>  on the wind of morning."

Björn Gustavsson, Erlang/OTP, Ericsson AB

More information about the erlang-questions mailing list