[#63592] [ruby-trunk - Bug #10009] IO operation is 10x slower in multi-thread environment — normalperson@...
Issue #10009 has been updated by Eric Wong.
3 messages
2014/07/08
[#63682] [ruby-trunk - Feature #10030] [PATCH] reduce rb_iseq_struct to 296 bytes — ko1@...
Issue #10030 has been updated by Koichi Sasada.
3 messages
2014/07/13
[#63703] [ruby-trunk - Feature #10030] [PATCH] reduce rb_iseq_struct to 296 bytes — ko1@...
Issue #10030 has been updated by Koichi Sasada.
3 messages
2014/07/14
[#63743] [ruby-trunk - Bug #10037] Since r46798 on Solaris, "[BUG] rb_vm_get_cref: unreachable" during make — ngotogenome@...
Issue #10037 has been updated by Naohisa Goto.
3 messages
2014/07/15
[#64136] Ruby 2.1.2 (and 2.1.1 and probably others) assumes a libffi with 3 version numbers in extconf.rb — "Jeffrey 'jf' Lim" <jfs.world@...>
As per subject.
4 messages
2014/07/31
[#64138] Re: Ruby 2.1.2 (and 2.1.1 and probably others) assumes a libffi with 3 version numbers in extconf.rb
— "Jeffrey 'jf' Lim" <jfs.world@...>
2014/07/31
On Thu, Jul 31, 2014 at 6:03 PM, Jeffrey 'jf' Lim <[email protected]>
[ruby-core:64057] [ruby-trunk - Feature #9781] [Closed] Feature Proposal: Method#super_method
From:
nobu@...
Date:
2014-07-26 16:22:52 UTC
List:
ruby-core #64057
Issue #9781 has been updated by Nobuyoshi Nakada.
Status changed from Open to Closed
% Done changed from 0 to 100
Applied in changeset r46964.
----------
proc.c: method_super_method
* proc.c (method_super_method): new method Method#super_method,
which returns a method object of the method to be called by
`super` in the receiver method object.
[ruby-core:62202] [Feature #9781]
----------------------------------------
Feature #9781: Feature Proposal: Method#super_method
https://bugs.ruby-lang.org/issues/9781#change-48067
* Author: Richard Schneeman
* Status: Closed
* Priority: Normal
* Assignee: okkez _
* Category: core
* Target version: current: 2.2.0
----------------------------------------
When `super` is called in a method the Ruby VM knows how to find the next ancestor that has that method and call it. It is difficult to do this manually, so I propose we expose this information in Method#super_location.
Ruby Method class (http://www.ruby-doc.org/core-2.1.1/Method.html) is returned by calling Object.method and passing in a method name (http://www.ruby-doc.org/core-2.1.1/Object.html#method-i-method). This is useful for debugging:
```ruby
# /tmp/code.rb
class Foo
def bar
end
end
puts Foo.new.method(:bar).source_location
# => ["/tmp/code.rb", 3]
```
The Object#method allows a ruby developer to easily track the source location of the method and makes debugging very easy. However if the code is being invoked by a call to `super` it is difficult to track down:
```ruby
# /tmp/code.rb
class BigFoo
def bar
end
end
class Foo < BigFoo
def bar
super
end
end
```
In this code sample it is easy to find the method definition inside of Foo but it is very difficult in large projects to find what code exactly `super` is calling. This simple example is easy, but it can be hard when there are many ancestors. Currently if I wanted to find this we can inspect ancestors
```ruby
Foo.ancestors[1..-1].map do |ancestor|
next unless ancestor.method_defined?(:bar)
ancestor.instance_method(:bar)
end.compact.first.source_location
```
To make this process simpler I am proposing a method on the Method class that would return the result of `super`
It could be called like this:
```ruby
Foo.new.method(:bar).super_method
```
I believe adding Method#super_method, or exposing this same information somewhere else, could greatly help developers to debug large systems easily.
--
https://bugs.ruby-lang.org/