Project

General

Profile

Feature #16781

alias :fold :reduce

Added by 0x81000000 (/ /) 4 months ago. Updated 3 months ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:97861]

Description

  1. Method "collect" has short synonym "map", short synonym of "inject" and "reduce" doesn't exist.
  2. Name "fold" is more common/popular than "reduce" or "inject".

In my own code I use:

module Enumerable
    alias :fold :reduce
end

I have no idea how to properly add "fold" in Ruby's stdlib/corelib.

Also available in: Atom PDF