Well, it sort of did. When implementing the `hash` method however, I realized
it's not that simple, and decided to use something like this:
import tables
type
FnSignatureTable = ref object
signatures: TableRef[string, seq[FnSignature]]
Run
Then
What mashigan wrote may well be best suited to your exact purpose. Another
possibility at least worth a shout out is `collections/critbits` which
implements an efficient `keysWithPrefix`. For more fuzzy still than prefix
matching, you could also do some kind of efficient edit distance-based
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 =
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