sawa, Could you elaborate? I still find that expression to be ambiguous. Here's another example that works with ruby 2.0.0-p247: ~~~ruby def foo(a, b = 0, c = 0) a + b + c end def bar(a = 1, b = 0) a + b end puts foo...adamdunson (Addie Drake)
Hi sawa, > Another case where similar syntax might be relevant is `| |` inside a block. ... should go together with ... arguments in method definition I agree. Arguments in method definitions have been on my to-do list — I haven't ...adamdunson (Addie Drake)
I should also mention that this patch does not apply to method definitions, so these still require commas (at least, for now): ~~~ruby def some_method(foo, bar, baz) # do stuff end ~~~ adamdunson (Addie Drake)
Adding a patch for method argument support. For example, this allows the following syntaxes: ~~~ruby Hash[ :foo, 'bar' :baz, 'qux' ] ~~~ which becomes `{ :foo => "bar", :baz => "qux" }`, as well as ~~~ruby puts("this i...adamdunson (Addie Drake)
I've attached a patch for array support (only between square brackets). I've also renamed the `assoc_seperator` rule to be `nl_or_comma` to make it a little more generic. This allows for syntax similar to hashes (here's a rather compl...adamdunson (Addie Drake)
Thanks for the patch, nobu. That was easier than I thought it would be; I was looking in the wrong place entirely. sawa (Tsuyoshi Sawada) wrote: > [...] I think it should not be just for hashes, but also for arrays, and for arguments...adamdunson (Addie Drake)
I feel the need to mention that at this time, my changes do not include Ruby 1.9 style symbol hashes. These still require commas, e.g., ~~~ruby some_hash = { foo: 'bar', bar: 'foo', baz: { qux: 'quux', corge: 'grau...adamdunson (Addie Drake)