feat: rename List.new(_,_) to List.filled(_,_) for clarity
The two-argument constructor `List.new(size, element)` was renamed to `List.filled(size, element)` to better convey its purpose of creating a list filled with a default value. The underlying primitive `list_newWithSizeDefault` remains unchanged. The test file `test/core/list/new_extra_args.wren` was updated to use the new name.
This commit is contained in:
@@ -3,6 +3,6 @@ var list = List.new(5)
|
||||
System.print(list.count) // expect: 5
|
||||
System.print(list) // expect: [null, null, null, null, null]
|
||||
|
||||
var list2 = List.new(5, 2)
|
||||
var list2 = List.filled(5, 2)
|
||||
System.print(list2.count) // expect: 5
|
||||
System.print(list2) // expect: [2, 2, 2, 2, 2]
|
||||
|
||||
Reference in New Issue
Block a user