supervisor, invalid_mfa

Hal Snyder hal@REDACTED
Mon Dec 17 10:08:14 CET 2001


Is the following an inconsistency?

The docs say Args below can be any Erlang term, but source code
suggests bad mojo unless Args is a list.

13> supervisor:start_link(my_sup, foo).
** exited: {start_spec,{invalid_mfa,{my_udps,start_link,foo}}} **


-- STDLIB Reference Manual / supervisor --

  EXPORTS
  
  start_link(Module, Args) -> Result
  start_link(SupName, Module, Args) -> Result
  
      Types: 
          SupName = {local,Name} | {global,Name}
           Name = atom()
          Module = atom()
==>       Args = term() 
          Result = {ok,Pid} | ignore | {error,Error}
           Pid = pid()
           Error = {already_started,Pid}} | shutdown | term()


-- $(ERL_TOP)/lib/stdlib/src/supervisor.erl --
  validFunc({M, F, A}) when atom(M), atom(F), list(A) -> true;
  validFunc(Func)                                 -> throw({invalid_mfa, Func}).


--

Nit: look for "d-tag" in
  http://www.erlang.org/doc/r8b/lib/kernel-2.7/doc/html/index.html



More information about the erlang-questions mailing list