General

Profile

adamdunson (Addie Drake)

  • Login: adamdunson
  • Registered on: 09/26/2013
  • Last sign in: 06/05/2024

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 0 1 1

Activity

10/12/2013

12:16 AM Ruby Feature #8956: Allow hash members delimited by \n inside of {}
Adding another patch with tests for no-comma hashes, arrays, and method arguments. adamdunson (Addie Drake)

10/10/2013

02:04 AM Ruby Feature #8956: Allow hash members delimited by \n inside of {}
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)
12:24 AM Ruby Feature #8956: Allow hash members delimited by \n inside of {}
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)

10/02/2013

05:08 AM Ruby Feature #8956: Allow hash members delimited by \n inside of {}
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)
04:47 AM Ruby Feature #8956: Allow hash members delimited by \n inside of {}
Sorry, the previous patch was incorrect (add-method-arg-support.patch). Please use the attached version instead. adamdunson (Addie Drake)
04:05 AM Ruby Feature #8956: Allow hash members delimited by \n inside of {}
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)

10/01/2013

05:53 AM Ruby Feature #8956: Allow hash members delimited by \n inside of {}
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)

09/28/2013

12:12 AM Ruby Feature #8956: Allow hash members delimited by \n inside of {}
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)

09/27/2013

02:11 AM Ruby Feature #8956: Allow hash members delimited by \n inside of {}
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)

09/26/2013

11:54 PM Ruby Feature #8956 (Rejected): Allow hash members delimited by \n inside of {}
Currently, hashes require members to be delimited by commas (`,`), even inside curly braces. E.g.,
~~~ruby
some_hash = {
:foo => 'bar',
:bar => 'foo',
:baz => {
:qux => 'quux',
:corge => 'grault'
}
}
~~~
In...
adamdunson (Addie Drake)

Also available in: Atom