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.
5 lines
80 B
Plaintext
5 lines
80 B
Plaintext
var map = new Map
|
|
|
|
IO.print(map.count) // expect: 0
|
|
IO.print(map) // expect: {}
|