feat: rename Sequence.list method to toList and update all call sites
The `.list` method on Sequence was renamed to `.toList` to better reflect its purpose of converting a sequence into a List object. This change updates the method definition in `builtin/core.wren` and `src/vm/wren_core.c`, along with all test files that called `.list` on sequences, maps, ranges, and custom sequence implementations. The test file `test/core/sequence/list.wren` was also renamed to `test/core/sequence/to_list.wren` to match the new method name.
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
var a = [1, 2, 3]
|
||||
var b = a.map {|x| x + 1 }.list
|
||||
var b = a.map {|x| x + 1 }.toList
|
||||
IO.print(b) // expect: [2, 3, 4]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var a = [1, 2, 3]
|
||||
var b = a.where {|x| x > 1 }.list
|
||||
var b = a.where {|x| x > 1 }.toList
|
||||
IO.print(b) // expect: [2, 3]
|
||||
|
||||
var c = a.where {|x| x > 10 }.list
|
||||
var c = a.where {|x| x > 10 }.toList
|
||||
IO.print(c) // expect: []
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
var a = 1..3
|
||||
var b = a.map {|x| x + 1 }.list
|
||||
var b = a.map {|x| x + 1 }.toList
|
||||
IO.print(b) // expect: [2, 3, 4]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var a = 1..3
|
||||
var b = a.where {|x| x > 1 }.list
|
||||
var b = a.where {|x| x > 1 }.toList
|
||||
IO.print(b) // expect: [2, 3]
|
||||
|
||||
var c = a.where {|x| x > 10 }.list
|
||||
var c = a.where {|x| x > 10 }.toList
|
||||
IO.print(c) // expect: []
|
||||
|
||||
@@ -8,4 +8,4 @@ class TestSequence is Sequence {
|
||||
iteratorValue(iterator) { iterator }
|
||||
}
|
||||
|
||||
IO.print((new TestSequence).list) // expect: [1, 2, 3]
|
||||
IO.print((new TestSequence).toList) // expect: [1, 2, 3]
|
||||
Reference in New Issue
Block a user