[erlang-questions] why there is no function proc_lib:start(Fun)?

Tomas Abrahamsson <>
Wed Oct 3 19:24:59 CEST 2007


On 10/2/07, YAMASHINA Hio <> wrote:
> When using proc_lib:start,
> I force to export the entry point function
> even if there is no need to invoke from
> outside of that module.
>
> There is proc_lib:spawn(Fun) function.
> Why proc_lib:start(Fun) does not exist?

I often wanted a proc_lib:start(Fun), too, but
one can use erlang:apply/2 as a workaround:

    proc_lib:start(erlang, apply, [fun() -> proc_lib:init_ack({ok, self()}),
					    do_something()
				   end,
				   []]).

This can be useful for functions in the
rpc module as well.


/Tomas



More information about the erlang-questions mailing list