Hello,
I want to perform fuzzy matching on table keys. What I mean by that, is:
import tables
type
Fn = proc (args: varargs[string]): int
FnSignature = tuple
name: string
arity: int
argTypes: seq[string]
var signatures = newTable[FnSignature, Fn]()
signatures.add(("print", 1, @["any"])) do (args: varargs[string]) -> int:
discard
echo signatures[("print", 1, @["string"])] # should return the first added
element, because ``any`` describes any type
Run
>From what I know about hash tables, it's not as simple as adding an equality
>operator overload to `FnSignature`. How do I achieve what I'm talking about?