From: MonkeeSage Date: 2007-12-15T04:10:00+09:00 Subject: Re: comma separated lists syntax error On Dec 13, 11:24 am, Phrogz wrote: > On Dec 12, 6:26 pm, ry dahl wrote: > > > > > > For the same obvious reasons as you desire that, does it sufficiently > > > please you that this alternate markup works: > > > > C:\>type tmp.rb > > > h = { > > > :a => 1, > > > :b => 2, > > > :c => 3, > > > } > > > > p h > > > > C:\>ruby tmp.rb > > > {:c=>3, :a=>1, :b=>2} > > No, the benefit is that the separators are at the beginning of the > > elements, aligned and in the same column so that it is easy to see one > > is not missing, you also don't need to maintain the commas at the end > > of the line. > > Ah; I thought the 'obvious' benefit you were referring to was that you > could copy/paste lines to change the order without having to remember > to use commas after every element except the last. In haskell (mainly because of "layout") and to a lesser extent, ocaml, people tend to format records (and such) with a syntax that commas line up with the opening/closing bracket, and appear on the line after the record field declaration. It makes kind of a visual "wall" between the name binding and the body of the declaration. It's just a matter of taste and custom, and really, even with haskell, some people format their code differently. Regards, Jordan