Project

General

Profile

Actions

Feature #11105

closed

ES6-like hash literals

Added by shugo (Shugo Maeda) almost 9 years ago. Updated over 6 years ago.

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

Description

Why not support ECMAScript6-like hash literals?

For example,

{x, y}

is equivalent to:

{x: x, y: y}

For convenience, the prefix of global, instance, and class variables should be removed from the key name as follows:

a = 1
B = 2
$c = 3
@d = 4
@@e = 5
p({a, B, $c, @d, @@e, f: 6})
#=> {:a=>1, :B=>2, :c=>3, :d=>4, :e=>5, :f=>6}

Files


Related issues 5 (0 open5 closed)

Related to Ruby master - Feature #13137: Hash ShorthandRejectedActions
Related to Ruby master - Feature #11104: ES6-like hash literalsRejected04/29/2015Actions
Related to Ruby master - Feature #14579: Hash value omissionClosedmatz (Yukihiro Matsumoto)Actions
Related to Ruby master - Feature #16095: 2 Features: remove (simplify) 'new' keyword and Property ShorthandRejectedActions
Has duplicate Ruby master - Feature #15236: add support for hash shorthandRejectedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0