Project

General

Profile

Actions

Feature #8987

open

map/collect extension which handles arguments

Added by sowieso (So Wieso) about 8 years ago. Updated almost 4 years ago.

Status:
Open
Priority:
Normal
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

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

Also available in: Atom PDF