Initial map implementation.
Still lots of methods missing and clean up and tests to do. Also still no literal syntax. But the core hash table code is there and working. The supported key types are all, uh, supported.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
var map = new Map
|
||||
IO.print(map.count) // expect: 0
|
||||
map["one"] = "value"
|
||||
IO.print(map.count) // expect: 1
|
||||
map["two"] = "value"
|
||||
IO.print(map.count) // expect: 2
|
||||
map["three"] = "value"
|
||||
IO.print(map.count) // expect: 3
|
||||
|
||||
// Adding existing key does not increase count.
|
||||
map["two"] = "new value"
|
||||
IO.print(map.count) // expect: 3
|
||||
Reference in New Issue
Block a user