First run at a dead-simple map library. Writing this has reminded me of the need for a []= operator as well as automatic generation of functions for objects, which really should also include ==

This commit is contained in:
Nathan Braswell
2015-06-27 10:04:09 -04:00
parent f3c0c8a705
commit b18c18ec30
6 changed files with 112 additions and 1 deletions

18
tests/test_map.krak Normal file
View File

@@ -0,0 +1,18 @@
import io:*
import map:*
fun main():int {
var m = map(3,1)
m.set(2,2)
m.set(1,3)
println(m[1])
println(m[2])
println(m[3])
m.set(3,4)
m.set(4,20)
println(m[1])
println(m[4])
println(m[2])
println(m[3])
return 0
}