From: edchick@... Date: 2018-10-19T16:23:49+00:00 Subject: [ruby-core:89478] [Ruby trunk Feature#15236] add support for hash shorthand Issue #15236 has been updated by Ksec (Ed Chick). shevegen (Robert A. Heiler) wrote: > Matz wrote in the other thread the following: > > "I am not positive about this syntax mostly because it appears to be set syntax, or old style hash in 1.8. > Once ES6 syntax become more popular, there will be chance for this change in the future. > > Matz." > > So I guess it could be discussed at another developer meeting in the future. But that comment was made three years ago. Time to do another review? ---------------------------------------- Feature #15236: add support for hash shorthand https://bugs.ruby-lang.org/issues/15236#change-74520 * Author: ignatiusreza (Ignatius Reza Lesmana) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- 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)`.. -- https://bugs.ruby-lang.org/ Unsubscribe: