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=AWL,BAYES_00, 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 4B3501F453 for ; Sat, 20 Oct 2018 02:23:32 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 7D7B312114C; Sat, 20 Oct 2018 11:23:27 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 5BAEA121014 for ; Sat, 20 Oct 2018 11:23:25 +0900 (JST) Received: by filter0113p3las1.sendgrid.net with SMTP id filter0113p3las1-11923-5BCA9199-D 2018-10-20 02:23:21.540247521 +0000 UTC m=+104004.704914675 Received: from herokuapp.com (ec2-54-196-15-69.compute-1.amazonaws.com [54.196.15.69]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id 39LopWKqThW8AImWFaKZWA for ; Sat, 20 Oct 2018 02:23:21.446 +0000 (UTC) Date: Sat, 20 Oct 2018 02:23:22 +0000 (UTC) From: matz@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 64874 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15236 X-Redmine-Issue-Author: ignatiusreza X-Redmine-Sender: matz 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS6LlFkM4/oRv66QAp9mNuVsGBNmkL78h2pKvw suEZc/WVA/n1mytnxR718RkHgZ8QiCd+00Rgs8qc/vGJ1bNaF/BET3AuXUfIPK411/rqtitehTWTQp EMBVag2h6YbNA6l9wWM0+Np9ug25FZ99J6F8d9i6vm5lBS1yLDwChxNDpg== X-ML-Name: ruby-core X-Mail-Count: 89488 Subject: [ruby-core:89488] [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 matz (Yukihiro Matsumoto). As a conservative old timer who does not use JavaScript at all, I still feel negative. It seems to work best with destructuring (left-hand side of assignments) which is nearly impossible in current Ruby syntax. But at the same time, I admit many of Ruby users use Rails and JavaScript, so I am open to hearing your opinion. Matz. ---------------------------------------- Feature #15236: add support for hash shorthand https://bugs.ruby-lang.org/issues/15236#change-74529 * 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/