From: zverok.offline@... Date: 2018-01-24T09:22:25+00:00 Subject: [ruby-core:85049] [Ruby trunk Feature#14390] UnboundMethod#to_proc Issue #14390 has been updated by zverok (Victor Shepelev). Ugh, seems it duplicates answer-less #10879. Though, I'd be happy to raise the priority of discussion higher, and to provide some real-life examples :) ---------------------------------------- Feature #14390: UnboundMethod#to_proc https://bugs.ruby-lang.org/issues/14390#change-69755 * Author: zverok (Victor Shepelev) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- I believe that it could be somewhat useful to have UnboundMethod converted to proc (accepting the object to bind to, as a first argument). Practical(ish) example, paired with [Proc#rcurry](https://bugs.ruby-lang.org/issues/11161) proposal: ```ruby URLS. map(&Faraday.method(:get).rcurry[some_get_param: 'value']). map(&JSON.method(:parse).rcurry[symbolize_names: true]). map(&Hash.instance_method(:dig).rcurry[:foo :bar, :baz]) ``` It is somewhat more verbose than a lot of alternative proposals for "shorthand of &method call with arguments", yet requires no changes in parser or language design. With some future shortcuts/operators for `#method` and `#instance_method` it can even become pretty short and look like an "idiom". -- https://bugs.ruby-lang.org/ Unsubscribe: