Plain values, text, chars, structs and enums by structure — or a type's own op equal_to and fn hash (it satisfies Key), with "equal keys hash the same" a check site the…
keys.zg
# Map keys (decided 2026-09-22): plain values, text, chars, structs and enums by structure —# or a type's own `op equal_to ` and `fn hash` (it satisfies `Key`), with "equal keys hash the same"# a check site the compiler must prove.interfaceKey<T>{opequal_to['a':<T>,'b':<T>]->bool;fnhash[lent'v':<T>]->uint64;}structPoint{x:int32,y:int32}# structural: fields decidestructUser{name:str.utf8}# its own rule: names compare lowercasedopequal_to['a':User,'b':User]->bool{returnstd::str.lower[lend'a'.name]equal_tostd::str.lower[lend'b'.name];}fnhash[lent'v':User]->uint64{let'low':=std::str.lower[lend'v'.name];returnstr.bytes[lend'low'];}UsersatisfiesKey;MAIN{letmut'grid':map[Point,str.utf8]=map.empty;map.set[lend.mut'grid',keyPoint[x=1,y=2],value"tree"];let'at':=map.get[lend'grid',keyPoint[x=1,y=2]]otherwise"nothing";std::print.useful['at',newln];letmut'users':map[User,int32]=map.empty;map.set[lend.mut'users',keyUser[name="Ann"],value1];let'n':=map.get[lend'users',keyUser[name="ANN"]]otherwise0;# same key by User's own equal_to std::print.useful['n',newln];}