[erlang-questions] yet another noob here

Delta37 <>
Thu Dec 11 00:11:13 CET 2008


Hello , you need to export proc/0 too
also 
-xports([sart/0,proc/0]).


maxoid wrote:
> 
> Hi, All, I am new to Erlang. Missing something obvious in the code below
> 
> -module(test).
> -export([start/0]).
> 
> proc() ->
>     true
> .
> 
> start() ->
>     spawn(?MODULE, proc, [])
> .
>     
> the session goes like this
> 
> 136> c("e:/developer/scripts/test.erl").
> e:/developer/scripts/test.erl:4: Warning: function proc/0 is unused
> {ok,test}
> 137> test:start().                      
> 
> =ERROR REPORT==== 10-Dec-2008::01:16:03 ===
> Error in process <0.3557.0> with exit value:
> {undef,[{test,proc,[]},{error_handler,crash,1}]}
> 
> <0.3557.0>
> 138>                                    
> 
> The questions I have are 
> 
> 1. Why it's crashing? 
> 2. Why does it produce a warning that 'proc/0' is unused?
> 
> I'm running 12B-5 on a single CPU Windows XP. Keeps me awake:)
> 
> Any ideas?
> Thanks
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/yet-another-noob-here-tp20930779p20946184.html
Sent from the Erlang Questions mailing list archive at Nabble.com.




More information about the erlang-questions mailing list