feat: add initial Map class with hash table, subscript, and count support
Implement the core Map data structure in Wren, including the ObjMap type with hash table storage, native methods for instantiation, subscript get/set, and count. Add Map class declaration to core.wren with a basic toString stub. Introduce MapEntry struct and hash table growth logic with configurable load factor. Add test files for map creation, count tracking, key type support (including null, bool, num, string, range, and class keys), and growth behavior. Refactor list capacity constants into shared MIN_CAPACITY and GROW_FACTOR macros. Change object equality operators to use wrenValuesSame instead of wrenValuesEqual.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
var map = new Map
|
||||
|
||||
IO.print(map.count) // expect: 0
|
||||
IO.print(map) // expect: {}
|
||||
Reference in New Issue
Block a user