Skip to content

Instantly share code, notes, and snippets.

@dom96

dom96/abc.nim Secret

Created December 7, 2015 16:38
Show Gist options
  • Save dom96/eb7ed68cbca07175bafc to your computer and use it in GitHub Desktop.
Save dom96/eb7ed68cbca07175bafc to your computer and use it in GitHub Desktop.
type
Foo = object
x: ref seq[int]
var f = Foo()
new(f.x)
echo(f.repr)
f.x[] = @[]
echo(f.repr)
f.x[].add(42)
echo(f.repr)
[x = ref 0x10ab1d050 --> nil]
[x = ref 0x10ab1d050 --> 0x10ab1e050[]]
[x = ref 0x10ab1d050 --> 0x10ab26050[42]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment