[erlang-bugs] Fwd: an error in the erlang tutorail

Jan Bölsche jan@REDACTED
Wed Apr 9 14:45:23 CEST 2008


Hi,

Matthias and me found a couple of problems in module five of the  
erlang tutorial.
(See below for details).
Would be great, if someone with permissions to do so could fix this.
Many thanks for your great work!
Jan

Begin forwarded message:
> From: Matthias Lang <matthias _a_t_ corelatus.se>
> Date: 8. April 2008 15:37:23 MESZ
> To: Jan Bölsche <jan _a_t_ muskelfisch.com>
> Subject: Re: an error in the erlang tutorail?
>
> Hi,
>
> You're quite right. In addition, the argument to server/1 should be
> 'Data' and not 'Date'. Also, it's a bad example because it impedes hot
> code loading.
>
> If I were you, I'd report it to erlang-bugs@REDACTED
>
> If you're shy, I can do it for you. (but tell me to)
>
> Matthias (I just maintain the FAQ)
>
> ----------------------------------------------------------------------
>
>
> Jan Bölsche writes:
>> Hi Matthias,
>>
>> I'm currently evaluating Erlang for use in an experimental  web-based
>> game project. And I am really pleased with what I figured out until  
>> now.
>> I think I spotted an error in the tutorial at http://www.erlang.org/course/advanced.html
>>
>> In Module 5 it says:
>>
>>> Last Call Optimisation
>>> The last call optimisation must be used in persistant servers.
>>>
>>> For example:
>>>
>>> server(Date) ->
>>>   receive
>>> 	{From, Info} ->
>>>           Data1 = process_info(From, Info, Data),
>>>           server(Data1);
>>> 	{From, Ref, Query} ->
>>>            {Reply, Data} = process_query(From, Query,Data),
>>>            From ! {Ref, Reply},
>>>            server(Data1)
>>>   end.
>>
>> Where I think it should say
>>
>>             {Reply, Data1} = process_query(From, Query,Data),
>>
>> because Dara is already bound and Data1 is otherwise only defined in
>> the {From, Info} branch but nevertheless used in the other branch.
>>
>> I am not sure whether you are the correct person to send this to but
>> I'll give it a try.
>>
>> Keep up the good work and thanks for sharing!
>>  Jan




More information about the erlang-bugs mailing list