Add `hash` function and equality operator `==` for custom key. import tables, hashes type Fn = proc (args: varargs[string]): int FnSignature = tuple name: string arity: int argTypes: seq[string] proc hash(fns: FnSignature): Hash = fns[0].hash proc `==`(a, b: FnSignature): bool = a[0] == b[0] var signatures = newTable[FnSignature, Fn]() signatures.add(("print", 1, @["any"])) do (args: varargs[string]) -> int: discard echo signatures[("print", 1, @["string"])]("whatev") Run
- Fuzzy matching on table keys lqdev
- Re: Fuzzy matching on table keys mashingan