Improvement of Symbol and Proc

Issue #4146 has been updated by ko1 (Koichi Sasada).

Assignee changed from ko1 (Koichi Sasada) to nobu (Nobuyoshi N.)

進んでないので,中田さん,どうぞよろしく.

Feature #4146: Improvement of Symbol and Proc
https://bugs.ruby-lang.org/issues/4146#change-31940

Author: nobu (Nobuyoshi N.)
Status: Assigned
Priority: Normal
Assignee: nobu (Nobuyoshi N.)
Category: core
Target version:

=begin
現在Symbol#to_procで %w[12 45 32].map(&:to_i) のようなことはできますが、
引数を付けてメソッドを呼ぶことはできません。Symbolリテラルに引数を付け
たらその引数と共にメソッドを呼ぶProcを作る構文というのはどうでしょうか。

%w[12 45 32].map(&:to_i(9)).map(&:*(2)) #=> [22, 82, 58]
%w[abc def ghi].map(&:[1]) #=> [“b”, “e”, “h”]
=end

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs