[erlang-questions] Using 'monitor' with spawn_opt/3 throws badarg. Documentation bug?

Rick Pettit rpettit@REDACTED
Mon Feb 23 21:13:40 CET 2015


I might have guessed the same, as I do not use spawn_opt/x much — but looking at the documentation for spawn_opt/3, that third argument is the set of *options* for the spawn opt, and *not* the set of arguments to pass to the fun.

-Rick

> On Feb 23, 2015, at 2:07 PM, e@REDACTED wrote:
> 
> the 0-ary function
> does not unify with a pair of arguments provided.
> i suspect this is the issue.
> 
> 
> On 02/23/2015 04:17 PM, Roger Lipscombe wrote:
>> I'm attempting to use spawn_opt/3 with a remote node, like this:
>> 
>>     Fun = fun() -> ok end,
>>     {Pid, Ref} = spawn_opt(Node, Fun, [link, monitor]).
>> 
>> It fails with:
>> 
>>     {badarg,
>>       [{erlang,spawn_opt,
>>        ['imp_server@REDACTED',erlang,apply,
>>         [#Fun<erl_eval.20.80484245>,[]],
>>         [link,monitor]],
>>        []}
>> 
>> Now, the documentation at
>> http://www.erlang.org/doc/man/erlang.html#spawn_opt-5 says that the
>> 'monitor' option is not allowed for spawn_opt/5. It says nothing about
>> spawn_opt/3.
>> 
>> Looking at the error message, it looks like spawn_opt/3 simply calls
>> spawn_opt/5. Does this note about 'monitor' being unsupported need to
>> be in documentation for both functions?
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list