ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: duerst@it.aoyama.ac.jp
To: ruby-core@ruby-lang.org
Subject: [ruby-core:82982] [Ruby trunk Feature#13551] Add a method to alias class methods
Date: Mon, 25 Sep 2017 09:01:22 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-66890.20170925090120.b65ee5e71331c76c@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-13551.20170509042019@ruby-lang.org

Issue #13551 has been updated by duerst (Martin Dürst).


shevegen (Robert A. Heiler) wrote:
> 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.

Sorry, I should have used another example than Array. This issue is about aliasing class methods, and aliasing a method in a builtin class would be a problem whether it's done with a new feature or with the way I showed. So the fact that I used Array is confusing, but orthogonal to the issue at hand.


----------------------------------------
Feature #13551: Add a method to alias class methods
https://bugs.ruby-lang.org/issues/13551#change-66890

* Author: JustJosh (Joshua Stowers)
* Status: Rejected
* 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/

      parent reply	other threads:[~2017-09-25  9:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-13551.20170509042019@ruby-lang.org>
2017-05-09  4:20 ` [ruby-core:81046] [Ruby trunk Bug#13551] Add a method to alias class methods stowers.joshua
2017-05-09  7:09 ` [ruby-core:81056] [Ruby trunk Feature#13551][Feedback] " duerst
2017-05-09  7:19 ` [ruby-core:81058] [Ruby trunk Feature#13551] " matthew
2017-05-09 16:23 ` [ruby-core:81077] " stowers.joshua
2017-05-10  7:43 ` [ruby-core:81086] " duerst
2017-05-21 17:29 ` [ruby-core:81319] " shevegen
2017-05-21 17:33 ` [ruby-core:81320] " shevegen
2017-06-14  3:07 ` [ruby-core:81676] " stowers.joshua
2017-06-14  3:08 ` [ruby-core:81677] " stowers.joshua
2017-09-25  8:13 ` [ruby-core:82973] [Ruby trunk Feature#13551][Rejected] " matz
2017-09-25  9:01 ` duerst [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-66890.20170925090120.b65ee5e71331c76c@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).