<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'>This is actually a relatively recent "feature" of the language that this can occur. Originally you had to write<br><br><div style="text-align: left;">(#haha{x=a})#haha{x=b}<br><br><div style="text-align: left;">i.e wrap expression in parentheses. So before this problem would not have occurred. But the need for the parentheses was removed as people complained that it didn't look very nice. Pet peeve of mine, the removing that is. I honestly don't think<br><br>#haha{x=a}#haha{x=b}<br><br>is more readable.<br></div><br>Robert<br></div><br><hr id="zwchr"><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div>+1. I also use this technique.<br><br>Sent from my iPhone</div><div><br>On 20.04.2012, at 18:59, "Håkan Nilsson" <<a href="mailto:hakan.nilsson@klarna.com" target="_blank">hakan.nilsson@klarna.com</a>> wrote:<br>
<br></div><div></div><blockquote><div><div>That's why it's preferable to have the convention to put the comma in the beginning om the line, like this:<br></div><div><br></div><div>[ #haha{v=1}</div><div>
, #haha{v=2}</div><div>, #haha{v=3}</div><div>].</div>

<div><br></div><div>It looks kinda funky at first sight, but once you get used to it then it will make your life easier.</div><br><div class="gmail_quote">2012/4/20 JD Bothma <span dir="ltr"><<a href="mailto:jbothma@gmail.com" target="_blank">jbothma@gmail.com</a>></span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sadly erlang doesn't allow a trailing comma in the last element like<br>
<br>
[<br>
 #haha{v=1},<br>
 #haha{v=2},<br>
 #haha{v=3},<br>
].<br>
<br>
otherwise, always trailing with a comma is a common best practise,<br>
e.g. in PHP arrays. When it becomes habit it's hardly a problem.<br>
<br>
Since this can silently cause bugs, the warning suggested in<br>
<a href="http://erlang.org/pipermail/erlang-bugs/2011-July/002528.html" target="_blank">http://erlang.org/pipermail/erlang-bugs/2011-July/002528.html</a> sounds<br>
like a good thing to push for, unless there's a better solution?<br>
<span class="HOEnZb"><font color="#888888"><br>
JD<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 20 April 2012 13:54, Serge Polkovnikov <<a href="mailto:serge.polkovnikov@gmail.com" target="_blank">serge.polkovnikov@gmail.com</a>> wrote:<br>
><br>
><br>
> 20 апреля 2012 г. 14:34 пользователь Vlad Dumitrescu <<a href="mailto:vladdu55@gmail.com" target="_blank">vladdu55@gmail.com</a>><br>
> написал:<br>
><br>
>> Hi Serge,<br>
>><br>
>> On Fri, Apr 20, 2012 at 13:27, Serge Polkovnikov<br>
>> <<a href="mailto:serge.polkovnikov@gmail.com" target="_blank">serge.polkovnikov@gmail.com</a>> wrote:<br>
>> > The compiler "eats" structures which are not separated by commas.<br>
>> > start() -><br>
>> >     [<br>
>> >      #haha{v=1}   %% No comma here<br>
>> >      #haha{v=2}   %% No comma here<br>
>> >      #haha{v=3}<br>
>> >     ].<br>
>><br>
>> No, the code is equivalent to ((#haha{v=1})#haha{v=2})#haha{v=3}.<br>
><br>
><br>
> Is there any simple way to protect such lists against the behaviour?<br>
>><br>
>><br>
>> Try the following to understand:<br>
>><br>
>> -record(haha,  { a,b,c } ).<br>
>>  start() -><br>
>>      [<br>
>>       #haha{a=1}   %% No comma here<br>
>>       #haha{b=2}   %% No comma here<br>
>>       #haha{c=3}<br>
>>      ].<br>
>><br>
>> regards,<br>
>> Vlad<br>
><br>
><br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div>Håkan Nilsson</div>
</div></blockquote><blockquote><div><span>_______________________________________________</span><br><span>erlang-questions mailing list</span><br><span><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a></span><br>
<span><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a></span><br></div></blockquote>
<br>_______________________________________________<br>erlang-questions mailing list<br>erlang-questions@erlang.org<br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote><br></div></body></html>