Skip to content

Instantly share code, notes, and snippets.

@dom96
Created January 9, 2019 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dom96/af65206852e17178a62a5265e05f2bce to your computer and use it in GitHub Desktop.
Save dom96/af65206852e17178a62a5265e05f2bce to your computer and use it in GitHub Desktop.
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