[#70252] Re: [ruby-cvs:58640] nobu:r51492 (trunk): node.c: NODE_ALLOCA for ALLOCV — Eric Wong <normalperson@...>
Besides possible backwards compatibility, can we drop volatile
3 messages
2015/08/05
[#70257] [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI — ko1@...
Issue #11420 has been reported by Koichi Sasada.
11 messages
2015/08/06
[#70337] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/11
Nice. Thank you guys for looking into this.
[#70349] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/12
Btw, did you consider using flexible array to avoid extra malloc
[#70355] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Юрий Соколов <funny.falcon@...>
2015/08/12
I thought to suggest to embed hash_id_table directly into places when it is
[#70356] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— SASADA Koichi <ko1@...>
2015/08/12
On 2015/08/13 4:29, Юрий Соколов wrote:
[#70358] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/12
SASADA Koichi <ko1@atdot.net> wrote:
[#70509] [Ruby trunk - Misc #11276] [RFC] compile.c: convert to use ccan/list — ko1@...
Issue #11276 has been updated by Koichi Sasada.
3 messages
2015/08/21
[#70639] the undefined behavior of an iterator if it is modified inside of the block to which it yields — Daniel Doubrovkine <dblock@...>
(this is my first time e-mailing list list, so apologies for any misstep :)
4 messages
2015/08/31
[ruby-core:70619] [Ruby trunk - Feature #11491] Add descriptive methods to Method & UnboundMethod
From:
eregontp@...
Date:
2015-08-28 08:47:14 UTC
List:
ruby-core #70619
Issue #11491 has been updated by Benoit Daloze.
#receiver is not ideal since it has a different meaning for Method ("receiver type" is more what we want).
In JRuby it is called "origin" ("orig" in MRI) and the documentation of UnboundMethod says:
Unbound methods can only be called after they are bound to an
object. That object must be a kind_of? the method's original class.
So I propose #origin, which goes well along #owner.
As for the instance/singleton method, maybe it would make sense to expose Class#singleton?.
But I am unsure of what would be a valid use case for such a predicate. Why do you want to know if it is a "class method" or not?
----------------------------------------
Feature #11491: Add descriptive methods to Method & UnboundMethod
https://bugs.ruby-lang.org/issues/11491#change-54025
* Author: Justin Searls
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
(Using Ruby Version 2.2.2)
I would like Method and Unbound Method to provide methods to provide the following additional information:
* `Method#instance_method?` and `UnboundMethod#instance_method?` to indicate whether the method is an instance or a class method
* `UnboundMethod#receiver` to provide the type required to be passed to `UnboundMethod#bind`
I believe this information is already probably readily available, because it can be gleaned from `Method#to_s` and `UnboundMethod#to_s`. For example:
```
> String.instance_method(:taint)
=> #<UnboundMethod: String(Kernel)#taint>
```
The above output tells us the eligible receiver type is String, the owner is Kernel, the "#" indicates an instance_method, and the name is taint. However, with the current UnboundMethod API, we can only tell the owner and the name.
It would be very useful to also see the receiver type and whether the method is an instance_method without performing Regex on the output of `to_s`.
In particular, `UnboundMethod#receiver` would be useful, even though UnboundMethod does not logically have a receiver, because it would make it easier to tell what type of objects can be passed to `UnboundMethod#bind` without raising a TypeError.
--
https://bugs.ruby-lang.org/