Use @munificent's single-argument reduce

This commit is contained in:
Luchs
2015-01-16 09:24:18 +01:00
parent 5a7b70d45c
commit 5cfb638fd1
3 changed files with 26 additions and 3 deletions

View File

@ -1 +1,2 @@
[1].reduce {|a, b| a } // expect runtime error: Range start out of bounds.
IO.print([1].reduce {|a, b| 42 }) // expect: 1
IO.print([].reduce(1) {|a, b| 42 }) // expect: 1