[#80974] [Ruby trunk Feature#13517] [PATCH] reduce rb_mutex_t size from 160 to 80 bytes on 64-bit — ko1@...
Issue #13517 has been updated by ko1 (Koichi Sasada).
4 messages
2017/05/02
[#81024] Re: [Ruby trunk Feature#13517] [PATCH] reduce rb_mutex_t size from 160 to 80 bytes on 64-bit
— SASADA Koichi <ko1@...>
2017/05/07
sorry for late response.
[#80996] [Ruby trunk Feature#13544] Allow loading an ISeqs sequence directly from a C extension without requiring buffer is in an RVALUE — sam.saffron@...
Issue #13544 has been reported by sam.saffron (Sam Saffron).
3 messages
2017/05/04
[#81016] [Ruby trunk Bug#13526] Segmentation fault at 0x0055c2e58e8920 ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] — s.wanabe@...
Issue #13526 has been updated by wanabe (_ wanabe).
3 messages
2017/05/07
[#81048] Re: [ruby-cvs:65788] normal:r58614 (trunk): rb_execution_context_t: move stack, stack_size and cfp from rb_thread_t — SASADA Koichi <ko1@...>
It causes compile error on raspi 3.
3 messages
2017/05/09
[#81201] Re: [ruby-cvs:65935] normal:r58761 (trunk): test/test_extilibs.rb: do not check the existence of fiddle — "U.NAKAMURA" <usa@...>
Hi, Eric
4 messages
2017/05/16
[#81202] Re: [ruby-cvs:65935] normal:r58761 (trunk): test/test_extilibs.rb: do not check the existence of fiddle
— Eric Wong <normalperson@...>
2017/05/16
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[#81427] Fwd: [ruby-changes:46809] normal:r58924 (trunk): test for IO.copy_stream CPU usage (r58534) — SASADA Koichi <ko1@...>
Hi,
6 messages
2017/05/28
[#81428] Re: Fwd: [ruby-changes:46809] normal:r58924 (trunk): test for IO.copy_stream CPU usage (r58534)
— Eric Wong <normalperson@...>
2017/05/28
SASADA Koichi <ko1@atdot.net> wrote:
[ruby-core:81319] [Ruby trunk Feature#13551] Add a method to alias class methods
From:
shevegen@...
Date:
2017-05-21 17:29:50 UTC
List:
ruby-core #81319
Issue #13551 has been updated by shevegen (Robert A. Heiler).
> Given that it's very easy (as shown by Matthew) to create such a method, do you think it's necessary that this
> be implemented by Ruby itself? You haven't yet answered the question about frequency of use or use cases.
Well I do not have a statistical dataset myself, but I use it all the time.
The thing is that for me it is very natural to use "alias".
def foo; puts 'hi from foo()'; end
alias bar foo
I love it. I love aliases. They make me happy. :)
I use aliases mostly because I have a bad memory. And also because
I want to remain flexible. Some time ago I started to adopt a more
"logical" scheme with my classes, when it may make sense. For example,
most of my classes, if necessary, have a "reset" method. Often I also
have a "menu" method, which I consider as the interface that can
parse the commandline (or optionally any other input that is sent
to it).
And so on and so forth.
So in this context, I totally agree with Joshua Stowers.
I think that ruby itself should not care too much if a user
wants to use an alias on the class/module level instance
or within the context of self with regular instance methods
of the class.
So here, I agree with Joshua.
The awkward thing, though, is that I actually dislike the syntax
proposal:
alias_class_method :new_name, :old_name
The reason is, and this may be trivial, is that I really really
hate the ',' character there. The symbols are ok although it's
better to avoid them.
I also understand that alias_method is not the same as alias,
but alias is so cute and short, it is just built to be loved!
Now you may wonder, how do I alias class methods then?
I use a VERY clumsy way. I do not recommend anyone to use it
and I am sure there are better ways but here goes:
self.instance_eval { alias stop_codons stop_codons? }
I dislike the self.instance_eval part because it is so long
and verbose - but I love the alias part within the { } because
to my eyes, it is neat and cuddly.
I can't say whether I would use alias_class_method - the name
is not soooo bad (though, what if we have a module Foo; end
method? Do we call it alias_module_method then?), but I am
not sure about the syntax.
BUT I also dislike typing the:
self.instance_eval { }
part altogether, so in this context, I agree with Joshua Stowers.
(I also understand that one should not use too many aliases but
I love aliases. The main method is usually the one I use the
most, and then I may use some aliases, some for backwards
compatbility and sometimes I remove them too at a later point
so it just provides some more flexibility "as you go".)
Anything that would be as neat or almost as short as:
"alias foo bar"
but for class-methods / module-methods would be great!
----------------------------------------
Feature #13551: Add a method to alias class methods
https://bugs.ruby-lang.org/issues/13551#change-65006
* 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/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>