namespace
Dict
A hash map from string keys to int values — the everyday lookup a game needs, like resource counts or an id registry by name. A Dict is backed by an open-addressing hash table (FNV-1a, linear probing, tombstone deletes, growing at load factor 0.7), so get/set/has are O(1) on average rather than the linear scan a list would give. Create one with Dict.new, then set / get / get_or / has / remove / size / clear / keys. Values are int (which also holds an entity or any small id); for richer values use the Value.* tree. Arguments are positional. The runtime is spliced in only when a program mentions Dict.* (or Set.*).
Dict.new() -> DictCreate an empty string-keyed map.Dict.set(d, key, value)Insert or update a key.Dict.get(d, key) -> intLook up a key (0 if absent).Dict.get_or(d, key, fallback) -> intLook up a key with an explicit default.Dict.has(d, key) -> boolIs a key present?Dict.remove(d, key)Delete a key.Dict.size(d) -> intHow many keys are stored.Dict.clear(d)Remove every key.Dict.keys(d) -> []pointerEvery key, as a slice of strings.