From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 514861F4B4 for ; Fri, 2 Apr 2021 04:11:30 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 93E9D1208DA; Fri, 2 Apr 2021 13:10:28 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id C97151208D0 for ; Fri, 2 Apr 2021 13:10:25 +0900 (JST) Received: by filterdrecv-p3iad2-7d7c446bd4-gbg4f with SMTP id filterdrecv-p3iad2-7d7c446bd4-gbg4f-18-6066996A-20 2021-04-02 04:11:22.528660436 +0000 UTC m=+812299.816335319 Received: from herokuapp.com (unknown) by ismtpd0170p1mdw1.sendgrid.net (SG) with ESMTP id VqDjLpVGTa-ZL-moRl0nGA for ; Fri, 02 Apr 2021 04:11:22.451 +0000 (UTC) Date: Fri, 02 Apr 2021 04:11:22 +0000 (UTC) From: sawadatsuyoshi@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 79206 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 17472 X-Redmine-Issue-Author: naruse X-Redmine-Sender: sawa 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: =?us-ascii?Q?jFXA8Rt481sXUUIO9tYW1AJlMOZdNdlSw=2F5TfLCefGvl=2FjB7KPn2pfvbkx1siQ?= =?us-ascii?Q?vOTxbbitHcaVi2d72emEY5mT9yZfX6jNT5bvnMK?= =?us-ascii?Q?gusPt=2Fq6Z1XCcEoYwA0uaWr6lMmlbDVMxGGmF+n?= =?us-ascii?Q?rtKEOL9HCgmEmkeK7H7tmUHMSw30A5ED9vhIlQC?= =?us-ascii?Q?AMBbjpfIJPfVnoouuuL2ybGQBkZmUVLDWA6XLFg?= =?us-ascii?Q?rsxJ2k727QXCFAooc=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 103163 Subject: [ruby-core:103163] [Ruby master Feature#17472] HashWithIndifferentAccess like Hash extension 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 #17472 has been updated by sawa (Tsuyoshi Sawada). I am surprised and am sad that so many of the core developers are positive on this. I am clearly against this feature, but being very generous, I think there can be two logically sane possibilities: 1. Ruby keeps the String-Symbol class distinction, and keeps them as well when used as hash keys. 2. Ruby dispenses the String-Symbol class distinction, and as a consequence, the distinction is lost in hash keys. The third case below, which is proposed here, does not make sense. 3. Ruby keeps the String-Symbol class distinction, but dispenses with them when used as certain types of hash keys. ---------------------------------------- Feature #17472: HashWithIndifferentAccess like Hash extension https://bugs.ruby-lang.org/issues/17472#change-91236 * Author: naruse (Yui NARUSE) * Status: Open * Priority: Normal * Target version: 3.1 ---------------------------------------- Rails has [ActiveSupport::HashWithIndifferentAccess](https://api.rubyonrails.org/classes/ActiveSupport/HashWithIndifferentAccess.html), which is widely used in Rails to handle Request, Session, ActionView's form construction, ActiveRecord's DB communication, and so on. It receives String or Symbol and normalize them to fetch the value. But it is implemented with Ruby. If we provide C implementation of that, Rails will gain the performance improvement. summary of previous discussion: https://github.com/rails/rails/pull/40182#issuecomment-687607812 -- https://bugs.ruby-lang.org/