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:
Bob Nystrom
2015-01-24 22:27:35 -08:00
parent cff08f989b
commit abe80e6d4b
11 changed files with 541 additions and 54 deletions
+12
View File
@@ -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