register BIF

Wes James comptekki@REDACTED
Tue Mar 15 22:06:42 CET 2011


On Tue, Mar 15, 2011 at 2:57 PM, Wes James <comptekki@REDACTED> wrote:
> If I do:
>
> Pid=timer2:timeout(0,0).
>
> register(blah, Pid).
>
> I get:
>
> ** exception error: bad argument
>     in function  register/2
>        called as register(blah,<0.33.0>)
>

<snip>

I hate it when I find an answer right after asking the list.

This:

http://www.erlang-solutions.com/thesis/erlang.html

pointed to the idea that in a spawn() there is spawn(arg1, arg1, arg3).

I did:

register(timer2, timer2:timeout(0,0)) and it worked.  The first timer2
is the module name.  I guess it wants the module name to register, not
just any atom.

-wes


More information about the erlang-questions mailing list