oops. #reduce is better than #inject

This commit is contained in:
Denis Knauf 2011-02-13 17:38:13 +01:00
parent 68ab7003d5
commit a97c4ed1f9

View file

@ -192,7 +192,7 @@ class Functional
end
end
class Inject <Base
class Reduce <Base
def initialize iv, *a, &e
super *a, &e
@buf = {}
@ -302,10 +302,9 @@ class Functional
push Map.new( &exe)
end
def inject iv, &exe
push Inject.new( iv, &exe)
def reduce iv, &exe
push Reduce.new( iv, &exe)
end
alias reduce inject
def select &exe
push Select.new( &exe)