Project

General

Profile

Actions

Feature #16781

open

alias :fold :reduce

Added by 0x81000000 (/ /) almost 4 years ago. Updated almost 4 years ago.

Status:
Open
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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0