Basic "What am I doing wrong?" question (Tuple argument to spawn? Dead pid intead of a runtime error?)

Jonathan Coupe jonathan@REDACTED
Fri Feb 14 19:21:42 CET 2003


> > start(Name) ->
> >  Pid = spawn(counter, loop, [{Name, 0}]),
>                ^^^^^^^
>
> There's the trouble: it should be 'ctr' (the name of the module)
> instead of 'control'. Alternatively you could use the built in macro
> ?MODULE, which expands to the module name as an atom.
>

Yeah, it's your basic idiotic syntax error. (Doh.) The tip about module is
nice. What I still don't understand is why I didn't get a runtime error..?

- Jonathan

PS Both Erik and Luke replied within the 5 minutes. Thanks!




More information about the erlang-questions mailing list