feat: add reduce method to Sequence with two overloads and tests
Implement `reduce` on the `Sequence` class in core.wren with two overloads: one taking an initial accumulator and a function, and another using the first element as the initial accumulator. Add three test files covering normal reduction, single-element edge case, and wrong arity error.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
[1, 2, 3].reduce {|x, y, z| x } // expect runtime error: Function expects more arguments.
|
||||
Reference in New Issue
Block a user