[erlang-questions] Comma, semicolon. Aaaaa

Lone Wolf hubaghdadi@REDACTED
Sat Sep 15 15:44:12 CEST 2007


Hi.
Well guys, I'm struggling with Erlang syntax.
Does Erlang has line terminators like C++ or Java?
Consider this sinppet:
----------
convert_list_to_c([{Name, {f, F}} | Rest]) ->
    Converted_City = {Name, {c, (F -32)* 5 / 9}},
    [Converted_City | convert_list_to_c(Rest)];
----------
Why there is a comma after {Name, {c, (F -32)* 5 / 9}} ?
  Another snippet and the same question:
----------
format_temps(List_of_cities) ->
    Converted_List = convert_list_to_c(List_of_cities),
    print_temp(Converted_List).
----------
  Another one:
----------
foreach(Fun, [First|Rest]) ->
    Fun(First),
    foreach(Fun, Rest);
----------
  How to define blocks? using { } for example ? or by using indentation (aka Python) ?
All these snippets are from Erlang docs.
Thanks.


    Deep into that darkness peering, long I stood there, wondering, fearing, Doubting, dreaming dreams no mortal ever dreamed before.
  E.A Poe
  
   



       
---------------------------------
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel and lay it on us.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070915/fb8fc919/attachment.htm>


More information about the erlang-questions mailing list