Project

General

Profile

Actions

Feature #8987

open

map/collect extension which handles arguments

Added by sowieso (So Wieso) about 11 years ago. Updated almost 7 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:57679]

Description

Please consider extending map/collect by allowing additional arguments to be passed to proc, like:
A: [1,2,3,4].map :+, 4
and/or
B: [1,2,3,4].map 4, &:+

=> [5, 6, 7, 8]

Variant A is probably more readable. Variant B is more versatile (allows arbitrary arguments to be passed to block).


Files

mappi.rb (410 Bytes) mappi.rb sample implementation in ruby (called mappi) sowieso (So Wieso), 10/05/2013 11:02 PM

Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #4146: Improvement of Symbol and ProcRejectednobu (Nobuyoshi Nakada)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0