Project

General

Profile

Actions

Misc #15431

open

Hashes and arrays should not require commas to seperate values when using new lines

Added by nsuchy (Nathaniel Suchy) almost 6 years ago. Updated almost 6 years ago.

Status:
Open
Assignee:
-
[ruby-core:90597]

Description

Ruby should not require commas for hash and array values if using new lines. I think the syntax would look cleaner without.

Example

myHash = {
  :key => “value”,
  :anotherKey => “another value”
}

Could be

myHash = {
  :key => “value”
  :anotherKey => “another value”
}

And

myArray = [
  1,
  2,
  3
]

Could be:

myArray = [
  1
  2
  3
]

The syntax looks a bit cleaner, with the new lines is there a need to require a comma? I look forward to hearing the community’s thoughts on this idea :)


Related issues 1 (1 open0 closed)

Is duplicate of Ruby master - Feature #10528: Allow line breaks instead of commas in arrays, hashes, argument lists, etc.OpenActions
Actions

Also available in: Atom PDF

Like1
Like0Like0Like0