Retoor software development Projects Research SearchXNG
Register Sign In

2 lines
75 B
Plaintext
Raw Normal View History

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.
2015-01-15 16:29:49 +01:00
[1].reduce {|a, b| a } // expect runtime error: Range start out of bounds.
Reference in New Issue Copy Permalink
afa0a0a8e9
wren/test/list/reduce_single_item.wren
Response time: 36ms
Mail Licenses API