From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 59E0D1F453 for ; Fri, 19 Oct 2018 16:23:57 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 075C3120E8C; Sat, 20 Oct 2018 01:23:55 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 0B92D120AFE for ; Sat, 20 Oct 2018 01:23:51 +0900 (JST) Received: by filter0046p3las1.sendgrid.net with SMTP id filter0046p3las1-8014-5BCA0514-1F 2018-10-19 16:23:48.554918867 +0000 UTC m=+68724.291359830 Received: from herokuapp.com (ec2-50-19-154-248.compute-1.amazonaws.com [50.19.154.248]) by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id GWGlB7kLThqO4JBeOpfoDw for ; Fri, 19 Oct 2018 16:23:48.400 +0000 (UTC) Date: Fri, 19 Oct 2018 16:23:49 +0000 (UTC) From: edchick@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 64864 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15236 X-Redmine-Issue-Author: ignatiusreza X-Redmine-Sender: Ksec X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6SGgcMLsIRk6ic/FIw8WF4m/hP3WlCx013WH 1futvyYHT2Y/IdBun5p4aGp5JuXZR+iZ9ieg0VJyIUl0p18Qq2QQzUjzjTvaM5KS1lxv92sbD59Pa+ 9c3NZ84eQjW+5kmd8FSjjcS1LyPN+g4hGh98qi2BtaIrGXAI9gHAqi/YtQ== X-ML-Name: ruby-core X-Mail-Count: 89478 Subject: [ruby-core:89478] [Ruby trunk Feature#15236] add support for hash shorthand X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" 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/