Fix my very very silly mistake of makeing keys and values the same type in map, also add a map.for_each function

This commit is contained in:
Nathan Braswell
2015-06-27 12:03:55 -04:00
parent dacfee6d22
commit 8feb9819b8
3 changed files with 16 additions and 1 deletions

View File

@@ -6,3 +6,8 @@
2
30
4
Lookie, a map!
What I get for not testing different types
key: 7, value: Lookie, a map!
key: 20, value: What I get for not testing different types
key: 30, value: we'll look for for_each too

View File

@@ -16,5 +16,11 @@ fun main():int {
println(m[2])
println(m[6])
println(m[3])
var mapEx = map(7, "Lookie, a map!")
mapEx[20] = "What I get for not testing different types"
mapEx[30] = "we'll look for for_each too"
println(mapEx[7])
println(mapEx[20])
mapEx.for_each(fun(key:int, value:char*) { print("key: "); print(key); print(", value: "); println(value); })
return 0
}