From: Iain Barnett Date: 2010-07-07T18:06:29+09:00 Subject: Re: Hashes don't allow preceding commas by design? On 7 Jul 2010, at 09:36, Peter Hickman wrote: > It's not hashes it is the parser in general. When it parses a line (up to > the newline) if the line appears compete then the parser expects a new > statement on the next line. So with > > 1: => a, b = 1, > 2: => 2 > > Line 1 is incomplete so the parser treats line 2 as a continuation of line > 1. But with > > 1: => a, b = 1 > 2: => ,2 > > Line 1 is complete in that the line contains a valid Ruby statement so the > parser expects the next line to be a new statement, line 2 is in error > because no valid Ruby statements start with a comma. > > This is what you are seeing in your examples. Thanks, I'm still getting used to Ruby's ways. Iain