Created
July 23, 2015 13:20
-
-
Save fowlmouth/104bf402de6ebd343b75 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 macros | |
var ct {.compileTime.} = 0 | |
proc nextID* : int {.compileTime.} = | |
result = ct | |
ct += 1 | |
macro decl (n): stmt = | |
var id = nextID() | |
result = quote do: | |
echo `id` | |
decl int | |
decl float | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment