Setting, getting and walking
proc main(): void {
mut hive.map.Map<Str, Int> counts = hive.map.new()
hive.map.set(counts, "bees", 12)
hive.map.set(counts, "hives", 3)
if hive.map.get(counts, "bees") is Result.Ok(n) {
echo n
}
echo hive.map.has(counts, "wasps")
hive.map.delete(counts, "hives")
echo hive.map.keys(counts)
echo hive.map.values(counts)
}
Crossing to and from a Table
proc main(): void {
mut hive.map.Map<Str, Str> labels = hive.map.new()
hive.map.set(labels, "bees", "many")
echo hive.map.toTable(labels)
echo hive.map.get(hive.map.fromTable([["wasps", "few"]]), "wasps")
}