Project

General

Profile

Actions

Feature #15236

closed

add support for hash shorthand

Added by ignatiusreza (Ignatius Reza Lesmana) about 6 years ago. Updated over 4 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:89468]

Description

PR in github: https://github.com/ruby/ruby/pull/1990

inspired by javascript support for object literal shorthand notation { a }, which will be expanded into { a: a }..

to avoid ambiguity, this shorthand is only supported when hash is defined with { } notation.. in other situation where the brackets is optional, e.g. function call, we still need to write it in full (m(a : a) instead of m(a), or m(a, b, c: c) instead of m(a, b, c)..


Related issues 2 (0 open2 closed)

Related to Ruby master - Feature #15286: Proposal: Add Kernel.#expand(*args)RejectedActions
Is duplicate of Ruby master - Feature #11105: ES6-like hash literalsRejectedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0