From: Tim Hunter Date: 2007-12-13T10:38:38+09:00 Subject: Re: comma separated lists syntax error Andrei Maxim wrote: > On 12/13/07, ry dahl wrote: >> I'm very disappointed that I cannot format my hashes like this >> { :a => 1 >> , :b => 2 >> , :c => 3 >> } >> The technique is popular in the haskell community; it has some obvious >> benefits over the traditional >> { :a => 1, >> :b => 2, >> :c => 3 >> } > > Just out of curiosity, what are those obvious benefits? It's the first > time I've seen somebody prefer commas at the beginning of a new row. > I do this with C code. The idea is that you should make a continuation (here I use "continuation" to mean the 2nd and subsequent parts of a single statement that is broken over several lines) visually distinct by starting the continuation with a token that can't legitimately start a new statement. I found the argument persuasive for C code. In Ruby, though, a comma at the end of a line is one of the ways to tell the parser that the statement is continued on the next line. Okay, different language, different rules. Nothing to get your panties in a wad about. Of course, I cut my teeth on FORTRAN, which used a non-blank character in column 1 to indicate a continuation, so my standards probably aren't as high as they should be. -- RMagick: http://rmagick.rubyforge.org/