[erlang-questions] supervisor name spec

Cobus Carstens cobus.carstens@REDACTED
Fri Feb 15 07:20:27 CET 2013

Hi all

The spec for supervisor:start_link/3 requires the SupName argument to be: 
-type sup_name() :: {'local', Name :: atom()} | {'global', Name :: atom()}.
supervisor:start_link/3 calls gen_server:start_link/4, which does not have 
a spec, but according to the source comments: "Name ::= {local, atom()} | 
{global, atom()} | {via, atom(), term()}"
gen_server:start_link/4 calls gen:start/6, with a spec which requires the 
Name argument to be: -type emgr_name()  :: {'local', atom()} | {'global', 
term()} | {via, atom(), term()}.

The question: Why does the SupName argument of supervisor:start_link/3 
function have the more restrictive {'global', Name :: atom()} spec as 
opposed to {'global', term()}, which is supported by gen:start/6 ?

P.S I used the R16A source code as reference, but it applies to earlier 
releases too.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130214/8ddf244c/attachment.htm>

More information about the erlang-questions mailing list