From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 734831BA010B for ; Mon, 22 May 2017 01:47:47 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id A2618B5D864 for ; Mon, 22 May 2017 02:33:46 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 8979718CC818 for ; Mon, 22 May 2017 02:33:46 +0900 (JST) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 6DCFA120789; Mon, 22 May 2017 02:33:45 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org 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 9A76912073E for ; Mon, 22 May 2017 02:33:42 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=evQRhdfHX24uWAlZxxR01gZVQKo=; b=b3/GHx6udejBHze2O3 a9IT3HSrfYw5YGdE9mZNZnc2ImK8nDK7ElNLyXXM7/6/TSVyK+aI/ZxrPx+mm9Ck YBOAkda2dQOe9Hf8AgWrHXKhcKAMT/vCjsTqjXtRGEXE3cM9LifQr7Jc3t+dgPrI oxv4+Q6grnV/kulYeIrWRQ6x8= Received: by filter1112p1mdw1.sendgrid.net with SMTP id filter1112p1mdw1-3325-5921CF73-12 2017-05-21 17:33:39.13695872 +0000 UTC Received: from herokuapp.com (ec2-54-234-105-146.compute-1.amazonaws.com [54.234.105.146]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id 6JyNVXgeQmmjIOuBbI4RYA Sun, 21 May 2017 17:33:39.071 +0000 (UTC) Date: Sun, 21 May 2017 17:33:39 +0000 From: shevegen@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56348 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13551 X-Redmine-Issue-Author: JustJosh X-Redmine-Sender: shevegen 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4evSa8COdQ4iAdDAo2A1fDAmwmUQNpkk1FoB libndzC/Um5KZCw6rWsHrkqyEUKNJNJJv6UI+M9kS0cYQlJqyOJh6jJSxvUO9wML2RTGvEsQZ9l2KG UW8syabmJq7NdHBxPMvWOU7wF3CXuExxmrhWGu8xxQcugTDWscWuL6hbQA== X-ML-Name: ruby-core X-Mail-Count: 81320 Subject: [ruby-core:81320] [Ruby trunk Feature#13551] Add a method to alias class methods 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 #13551 has been updated by shevegen (Robert A. Heiler). Martin showed this example: > class Array > class << self > alias :my_new :new > end Ruby allows this flexibility, this is true. This is also great, we love it. But when you use this code and want to distribute it, it is more cumbersome. And not everyone likes to have modifications that are non-standard ruby in their code. I understand that the ruby team wants to be conservative and not proliferate with lots of extra methods that have only a special case (say active* gems), but to me I also completely understand Joshua Stowers here - if possible it is MUCH, much better when it would be in main ruby. So that everyone could use it. - I may use it if it is in ruby core/stdlib. - I may use duck patching (sometimes people use the monkey rather than the duck) for my local code. - But it is VERY unlikely that I would modify a core class of ruby like this AND distribute my code to other people too. I just consider it too cumbersome (and refinements, while the idea is ok, I never really liked the syntax... and it felt awkward... but this is for another discussion, lots of time towards ruby 3.x I hope). ---------------------------------------- Feature #13551: Add a method to alias class methods https://bugs.ruby-lang.org/issues/13551#change-65007 * Author: JustJosh (Joshua Stowers) * Status: Feedback * Priority: Normal * Assignee: * Target version: ---------------------------------------- There doesn't seem to be an intuitive way to alias class methods. Perhaps we can add a method such as ~~~ ruby alias_class_method :new_name, :old_name ~~~ -- https://bugs.ruby-lang.org/