Commit Graph
2 Commits
Author SHA1 Message Date
root 02c2981d36 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.
2016-07-17 02:24:19 +00:00
root 89037e397a feat: add list constructors with size and default value arguments
Implement two new List constructors: `List.new(size)` creates a list of given size initialized to null, and `List.new(size, default)` creates a list with all elements set to the provided default value. Add corresponding C primitives `list_newWithSize` and `list_newWithSizeDefault` in wren_core.c, register them in the core initialization, and include test coverage for both constructors. Also add Max Ferguson to AUTHORS.
2016-07-17 02:01:50 +00:00