3. multi and map

Two containers: multi T (a growable list) and map<K, V>. A map read m[k] answers nil when the key is absent — the everyday idiom for optional lookups like HTTP headers. for .. in walks both.

let langs: multi Text = ["c", "ocaml", "writeonce"];
push(langs, "more");
print("count ${len(langs)}");

let ages: map<Text, Int> = {};
ages["ada"] = 36;
let a = ages["grace"];   -- ?Int: nil, no trap
if a == nil { print("unknown"); }

for l in langs {
  print(l);
}
for k, v in ages {
  print("${k} is ${v}");
}

Chapters