Last active
February 29, 2016 14:51
-
-
Save def-/e8183e5516c57babbe20 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| type X = ref object | |
| case kind*: bool | |
| of false: | |
| discard | |
| of true: | |
| fields*: Table[int, int] | |
| var t = X(kind: true, fields: initTable[int, int]()) | |
| t.fields[0] = 5 | |
| echo t.fields[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment