[erlang-questions] Hello,I have a question about erlang

fan li bjgoods@REDACTED
Wed Nov 28 09:10:42 CET 2007


To Fan Li:
	I have now tried to submit your question to erlang-questions@REDACTED

To erlang-questions:
	The guy apparently has got a broken R11B-5 installation.
	Any clues anyoune?



On Wed, Nov 28, 2007 at 08:42:26AM +0800, fan li wrote:
> hello
> my erlang version is 5.5.5
> now error is still there.Every code is not compiles.
> 
> Eshell V5.5.5  (abort with ^G)
> 1> c(counter).
> ./counter.erl:none: internal error in lint_module;
> crash reason: {undef,[{sets,to_list,[[]]},
>                       {erl_lint,check_unused_records,2},
>                       {erl_lint,module,3},
>                       {compile,lint_module,1},
>                       {compile,'-internal_comp/4-anonymous-1-',2},
>                       {compile,fold_comp,3},
>                       {compile,internal_comp,4},
>                       {compile,internal,3}]}
> error
> 
> 
> 
> 
> 2007/11/27, Raimo Niskanen <raimo+mailman@REDACTED>:
> >
> > Hello.
> >
> > I am afraid you have sent your question to the list owner (me) and
> > not to the list. Try resending your message to:
> >        erlang-questions@REDACTED
> >
> > Please supply exact version of your erlang installation,
> > for example the shell startup prompt, because I see
> > nothing wrong with your code, and it compiles with
> > R11B-5 only giving a warning:
> > ./counter.erl:23: Warning: variable 'Other' is unused
> >
> > You also have mis-spelled increment as "increament"
> > (intentionally?), your stop function sends {self(),stop}
> > but receives 'stop', so it is broken.
> >
> > Other than that the lint error you see is an internal error
> > that should not happen, and it does not happen for me
> > so the list will need exact erlang version...
> >
> >
> >
> > On Tue, Nov 27, 2007 at 09:19:57AM +0800, fan li wrote:
> > > hi
> > > I have a question.
> > > code :
> > >
> > > -module(counter).
> > > -compile(export_all).
> > > start()->spawn(counter, loop,[0]).
> > > increment(Counter)->
> > >     Counter!increament.
> > > value(Counter)->
> > >     Counter!{self(),value},
> > >     receive
> > >         {Counter,Value}->
> > >             Value
> > >         end.
> > >  stop(Counter)->
> > >      Counter!{self(),stop}.
> > >  loop(Val)->
> > >      receive
> > >          increament->
> > >              loop(Val+1);
> > >          {From,value}->
> > >              From!{self(),Val},
> > >              loop(Val);
> > >          stop->
> > >              true;
> > >           Other->
> > >             loop(Val)
> > >       end.
> > >
> > >
> > > result:
> > > ./encode.erl:none: internal error in lint_module;
> > > crash reason: {undef,[{sets,to_list,[[]]},
> > >                       {erl_lint,check_unused_records,2},
> > >                       {erl_lint,module,3},
> > >                       {compile,lint_module,1},
> > >                       {compile,'-internal_comp/4-anonymous-1-',2},
> > >                       {compile,fold_comp,3},
> > >                       {compile,internal_comp,4},
> > >                       {compile,internal,3}]}
> > > error
> > >
> > > what wrong?
> > >
> > > thanks a lot!
> > >
> > >
> > >
> > > fan li
> >
> > --
> >
> > / Raimo Niskanen, Erlang/OTP, Ericsson AB
> >

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list