feat: implement List instantiation via "new" and fix inline functions to static
Add `list_instantiate` native to create empty lists, bind it to List's metaclass for `new` support, and remove the related TODO. Also change three `inline` functions in `wren_value.h` to `static inline` to prevent linker errors. Include a new test `test/list/new.wren` verifying `new List` yields an empty list that supports `add`.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
var list = new List
|
||||
|
||||
IO.print(list.count) // expect: 0
|
||||
IO.print(list) // expect: []
|
||||
list.add(1)
|
||||
IO.print(list) // expect: [1]
|
||||
Reference in New Issue
Block a user