Project

General

Profile

Actions

Feature #19567

open

Add Oxford Comma Support for better readability

Added by tenderlovemaking (Aaron Patterson) over 1 year ago. Updated over 1 year ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:113068]
Tags:

Description

Ruby has regular commas:

[a, b, c]

Ruby has trailing commas:

[
 a,
 b,
 c,
]

But I think both of these are hard to read compared to the Oxford comma.
We should introduce the Oxford comma so that code is easier to read:

For example:

def foo a, b, and c
  [a, b, and c]
end

p foo(1, 2, and 3)

As an added bonus, this feature also makes specifying musical beats
quite natural, for example:

[1, and 2, and 3, and 4]

Just to make sure that everyone is pleased, you are allowed to mix the
Oxford comma with trailing commas like this:

[
  1,
  and 2,
  and 3,
  and 4,
]

Files

0001-Add-Oxford-Comma-support.patch (2.09 KB) 0001-Add-Oxford-Comma-support.patch tenderlovemaking (Aaron Patterson), 04/01/2023 05:26 AM
Actions

Also available in: Atom PDF

Like12
Like0Like1Like1