Project

General

Profile

Actions

Feature #15955

closed

UnboundMethod#apply

Added by nelhage (Nelson Elhage) almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:93337]

Description

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 UnboundMethods 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


Files

umethod_apply.patch (5.01 KB) umethod_apply.patch mame (Yusuke Endoh), 08/23/2019 02:40 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0