From: ry dahl Date: 2008-04-12T21:53:57+09:00 Subject: Re: syntax request Yushuke, Great! Thanks Matz, Is it possible to get this in 1.8.7? ry On Fri, Apr 11, 2008 at 1:06 PM, Yusuke ENDOH wrote: > Hi, > > 2008/4/6 ry dahl : > > > But an alternate style which is often used in Haskell code is putting > > commas before the arguments and aligned in the same column > > > > function( long_argument1 > > , long_param > > , long_arg3 > > , something else > > ) > > > > I think this looks better and is easier to edit. > > How very true. It's very cool. > Before reading this thread, I did not know that we can write in 1.9: > > > puts object > > .methods > > I love the style too. > > > Even if I look at the situation objectively, comma may (or should) be > able to be put in a next line, as long as dot is able. > > > > $ ./ruby -e ' > x = { 1 => "1" > , 2 => "2" > , 3 => "3" > } > p x[3] > ' > "3" > > $ ./ruby -e ' > def foo(*r) > p r.join(", ") > end > > foo( "foo" > , "bar" > , "baz" > ) > ' > "foo, bar, baz" > > > Index: parse.y > =================================================================== > --- parse.y (revision 15977) > +++ parse.y (working copy) > @@ -6096,6 +6096,9 @@ > } > while ((c = nextc())) { > switch (c) { > + case ',': > + pushback(','); > + goto retry; > case ' ': case '\t': case '\f': case '\r': > case '\13': /* '\v' */ > space_seen++; > > -- > Yusuke ENDOH > >