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.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
var a = 1..3
|
||||
var b = a.map(fn (x) x + 1)
|
||||
IO.print(b) // expect: [2, 3, 4]
|
||||
Reference in New Issue
Block a user