-
-
Save dom96/af65206852e17178a62a5265e05f2bce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tables, hashes | |
type | |
Foo = ref object | |
s: string | |
proc hash(f: Foo): Hash = | |
hash(f.s) | |
let f = Foo(s: "hello!") | |
let x = { | |
f: "hello!" | |
}.toTable[:Foo, string]() | |
echo x[f] | |
f.s = "uhh ohh" | |
echo x[f] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment