From: eregontp@... Date: 2019-07-26T18:47:25+00:00 Subject: [ruby-core:93936] [Ruby master Feature#15955] UnboundMethod#apply Issue #15955 has been updated by Eregon (Benoit Daloze). I think this makes sense for convenience and better performance on MRI or during interpretation (vs in compiled code). Using an UnboundMethod for getting a copy of a method at a given time is indeed a good usage, we use it in TruffleRuby quite a bit. For the specific case of `is_a?`, may I recommend using `Module#===`? That's much less often overridden, and it works for BasicObject (#is_a? is only defined in Kernel, so not for BasicObject). ---------------------------------------- Feature #15955: UnboundMethod#apply https://bugs.ruby-lang.org/issues/15955#change-80098 * Author: nelhage (Nelson Elhage) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- I'd love a way to apply an UnboundMethod to a receiver and list of args without having to first `bind` it. I've ended up using `UnboundMethod`s in some hot paths in my application due to our metaprogramming idioms, and the allocation from `.bind` is comparatively expensive. I'd love `unbound_method.apply(obj, args���)` to be equivalent to `unbound_method.bind(obj).call(args���)` but without allocating the intermediate `Method` -- https://bugs.ruby-lang.org/ Unsubscribe: