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.0 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_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 8BC13211B3 for ; Mon, 3 Dec 2018 11:16:08 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id B7868120971; Mon, 3 Dec 2018 20:16:06 +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 A34FC120971 for ; Mon, 3 Dec 2018 20:16:03 +0900 (JST) Received: by filter0040p3iad2.sendgrid.net with SMTP id filter0040p3iad2-30252-5C051070-2E 2018-12-03 11:16:00.697298416 +0000 UTC m=+1523537.015276586 Received: from herokuapp.com (ec2-54-160-199-4.compute-1.amazonaws.com [54.160.199.4]) by ismtpd0003p1iad2.sendgrid.net (SG) with ESMTP id jUnDThL9QUuviZgpZsnxNQ for ; Mon, 03 Dec 2018 11:16:00.652 +0000 (UTC) Date: Mon, 03 Dec 2018 11:16:00 +0000 (UTC) From: manga.osyo@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 65654 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15373 X-Redmine-Issue-Author: osyo X-Redmine-Sender: osyo 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4HqKA3Jjl6IeQ9brZDTA0XQ5ALNeg0sLCQjo wlYTgjNeMj3tW/svSr3Ym7q872LfbSAla26zIY82yfUt+p/HY/6NhlByu8G9TrjHx1REGo+Fmi9iGi KYMsVUh6qEDxaCUpAeQwfPfXdJErdccqUu9lqzARKhIOr/LTcRuN5skZng== X-ML-Name: ruby-core X-Mail-Count: 90259 Subject: [ruby-core:90259] [Ruby trunk 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 osyo (manga osyo). Thank you! shevegen :) ---------------------------------------- Feature #15373: Proposal: Enable refinements to `#method` and `#instance_method` https://bugs.ruby-lang.org/issues/15373#change-75374 * Author: osyo (manga osyo) * Status: Open * 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/