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:
Bob Nystrom
2014-04-08 14:31:23 +00:00
parent 8113e0bfc0
commit 8d1e9750b8
3 changed files with 15 additions and 5 deletions
+6
View File
@@ -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]