Commit Graph

3 Commits

Author SHA1 Message Date
Bob Nystrom
31ee167168 feat: extract map and where into Sequence base class for List and Range
Extract the common `map` and `where` methods from `List` into a new `Sequence` base class, making `List is Sequence` and `Range is Sequence`. Remove duplicate native method registrations for Range in wren_core.c and add new test files for Range map/where operations.
2014-02-16 17:20:31 +00:00
Kyle Marek-Spartz
edaf529598 chore: replace IO.write with IO.print and fix array spacing in map test
- Change IO.write to IO.print for output consistency in map.wren test
- Add spaces after commas in array literal [1, 2, 3] to match style guide
2014-02-15 06:34:30 +00:00
Kyle Marek-Spartz
48ef257973 feat: add List.map method with test for element transformation
Implement a `map` method on the List class that applies a given function `f` to each element, returning a new list with the transformed values. Includes a test case verifying incrementing each element by 1.
2014-02-15 05:06:29 +00:00