oops. #reduce is better than #inject

master
Denis Knauf 2011-02-13 17:38:13 +01:00
parent 68ab7003d5
commit a97c4ed1f9
1 changed files with 3 additions and 4 deletions

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)