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=-3.9 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham 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 42EDE1F463 for ; Tue, 24 Dec 2019 01:39:20 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 135C5120B02; Tue, 24 Dec 2019 10:39:08 +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 F0FCF120B00 for ; Tue, 24 Dec 2019 10:39:04 +0900 (JST) Received: by filterdrecv-p3mdw1-56c97568b5-72qfl with SMTP id filterdrecv-p3mdw1-56c97568b5-72qfl-18-5E016C41-9 2019-12-24 01:39:13.20706366 +0000 UTC m=+608166.062919057 Received: from herokuapp.com (unknown [54.226.93.224]) by ismtpd0097p1iad2.sendgrid.net (SG) with ESMTP id NcgDfbEzTJCSde43ECBWgQ for ; Tue, 24 Dec 2019 01:39:13.141 +0000 (UTC) Date: Tue, 24 Dec 2019 01:39:13 +0000 (UTC) From: nobu@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72105 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15373 X-Redmine-Issue-Author: osyo X-Redmine-Sender: nobu 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?q8Dly+pU2+3ektTtZVXgZtbJPXwqo7p86jCsvYTW4Bz=2Fdz3HXMYoYabdulT+ZF?= =?us-ascii?Q?ovcydoaZ5WdvKTYTtZNQfrXa3zGy2z5elnRvWNu?= =?us-ascii?Q?=2F=2Fq5Sg9A7wsIEEoS1w79St+3mNjiV4=2FLN6NrJWi?= =?us-ascii?Q?akGJPiR4tGM78QESHihGwrA1n7S0Uv6BCFXlEeA?= =?us-ascii?Q?qeJb=2Fx3HVmWROJ9e6aQh5zgYmYBLIxmtpUPUMMN?= =?us-ascii?Q?S2JhFUysGjP218QHE=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96446 Subject: [ruby-core:96446] [Ruby master Feature#15373] Proposal: Enable refinements to `#method` and `#instance_method` 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 #15373 has been updated by nobu (Nobuyoshi Nakada). https://docs.google.com/document/u/1/d/1W_wrFsFxxU1MepA6HBpfl-9h-nLD8EBsgMsS7yTDvHE/pub ---------------------------------------- Feature #15373: Proposal: Enable refinements to `#method` and `#instance_method` https://bugs.ruby-lang.org/issues/15373#change-83370 * Author: osyo (manga osyo) * Status: Closed * Priority: Normal * Assignee: * Target version: ---------------------------------------- Proposal enable refinements to `#method` and `#instance_method`. It can be used in the following cases. ```ruby # default call to #pp module P2PP refine Kernel do def p obj pp obj end end end using P2PP # call to Kernel.#pp [1, 2, 3].map(&method(:p)) ``` Also, when checking the defined position as follows, the `refine` place is reflected. ```ruby module P2PP refine Kernel do def p obj pp obj end end end # Output to refine defined position # Before p method(:p).source_location # => nil p Kernel.instance_method(:p).source_location # => nil using P2PP # After p method(:p).source_location # => ["../ruby/test.rb", 4] p Kernel.instance_method(:p).source_location # => ["../ruby/test.rb", 4] ``` I want `.:` operators to work. https://bugs.ruby-lang.org/issues/13581 pull reqiest: https://github.com/ruby/ruby/pull/2034 -- https://bugs.ruby-lang.org/