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.8 required=3.0 tests=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 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 B74441F4BD for ; Sat, 5 Oct 2019 19:04:16 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id B2B79120969; Sun, 6 Oct 2019 04:04:06 +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 BFE04120954 for ; Sun, 6 Oct 2019 04:04:04 +0900 (JST) Received: by filter0130p3las1.sendgrid.net with SMTP id filter0130p3las1-14419-5D98E924-65 2019-10-05 19:04:04.515998083 +0000 UTC m=+174053.696991718 Received: from herokuapp.com (unknown [18.234.90.121]) by ismtpd0059p1iad1.sendgrid.net (SG) with ESMTP id k6ubjEWNQ4ur-cxFxnJ2mA for ; Sat, 05 Oct 2019 19:04:04.432 +0000 (UTC) Date: Sat, 05 Oct 2019 19:04:04 +0000 (UTC) From: dementiev.vm@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 70821 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16241 X-Redmine-Issue-Author: palkan X-Redmine-Sender: palkan 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?b=2FcNIjh4Liaf+STkGzZqvPsYqW9li6h8t0C72DyKBUGnFQJCCYqHCi+4DP9PNi?= =?us-ascii?Q?dlP7pu7LPwLJTLNtWvDvu+FxdpEDRXCqIFWrOO8?= =?us-ascii?Q?=2FRMT3lGrRAnfsI3p=2FmNRdL2WehLcDGYfZQj5Lme?= =?us-ascii?Q?IDf8l24E1rgjkzPPppNrcrqNIclHhDe1XDcpbUK?= =?us-ascii?Q?u8AMR1MfWmi8gLURI2RVEHUvLQjfFv0wHsg=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95234 Subject: [ruby-core:95234] [Ruby master Feature#16241] Shorter syntax for anonymous refinements 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 #16241 has been reported by palkan (Vladimir Dementyev). ---------------------------------------- Feature #16241: Shorter syntax for anonymous refinements https://bugs.ruby-lang.org/issues/16241 * Author: palkan (Vladimir Dementyev) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- The original discussion is here https://bugs.ruby-lang.org/issues/14344. tl;dr - Refinements are often used in-place with anonymous modules - Having shorter syntax could lower the barrier of entry for Rubyist wanting to explore this feature - Previous syntax suggestions were not accepted. I suggest adding a shorter syntax (technically, API): ```ruby # before using(Module.new do refine Array do def foo;"bar";end end end) # after refining Array do def foo; "bar"; end end ``` The original idea was to use `using_refined` instead of `refining` but after discussing with Matz we decided that it's too verbose, and `refining` seems better. But is it good enough? Any thoughts? -- https://bugs.ruby-lang.org/