Hi Lone,<br><br>I'll try to give you my view on the syntax. The comma (,) is like (;) in languages like Java/C. Each method is ended with a Dot (.). If you have more than one method with the same number parameters (called arity in Erlang), you need to separate them with (;). There is no similar construct in Java/C for this.
<br><br>Similarly, you can think of if/case statements, which use (;) to separate different if/case conditions, (,) to separate clauses for each condition, and (.) to indicate the end of if/case statement.<br><br>I hope this helps.
<br><br>Best regards,<br><br>Ahmed Al-Issaei<br> <br><div><span class="gmail_quote">On 9/15/07, <b class="gmail_sendername">Lone Wolf</b> <<a href="mailto:hubaghdadi@yahoo.ca">hubaghdadi@yahoo.ca</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hi.<br>Well guys, I'm struggling with Erlang syntax.<br>Does Erlang has line terminators like C++ or Java?<br>Consider this sinppet:<br>----------<br>convert_list_to_c([{Name, {f, F}} | Rest]) -><br> Converted_City = {Name, {c, (F -32)* 5 / 9}},
<br> [Converted_City | convert_list_to_c(Rest)];<br>----------<br>Why there is a comma after {Name, {c, (F -32)* 5 / 9}} ?</div> <div>Another snippet and the same question:<br>----------<br>format_temps(List_of_cities) ->
<br> Converted_List = convert_list_to_c(List_of_cities),<br> print_temp(Converted_List).<br>----------</div> <div>Another one:<br>----------<br>foreach(Fun, [First|Rest]) -><br> Fun(First),<br> foreach(Fun, Rest);
<br>----------</div> <div>How to define blocks? using { } for example ? or by using indentation (aka Python) ?<br>All these snippets are from Erlang docs.<br>Thanks.</div><br><br><div> <div align="left"> <div align="left">
<font color="#444f75" face="georgia" size="2"><strong><em>Deep into that darkness peering, long I stood there, wondering, fearing, Doubting, dreaming dreams no mortal ever dreamed before.</em></strong></font></div> <div align="center">
<strong><font color="#444f75" face="Verdana"><em>E.A Poe</em></font></strong></div><span class="ad"> <div align="center"><strong><font color="#444f75" face="verdana" size="7"><em></em></font></strong></div> <div align="left">
<strong><font color="#444f75" face="verdana"><em></em></font></strong> </div></span></div></div><span class="ad"><p>
</p><hr size="1">Fussy? Opinionated? Impossible to please? Perfect. <a href="http://us.rd.yahoo.com/evt=48516/*http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7+" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Join Yahoo!'s user panel</a> and lay it on us.
<p></p></span><br>_______________________________________________<br>erlang-questions mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br></blockquote>
</div><br>