Skip to content

Instantly share code, notes, and snippets.

@theduke
Last active November 11, 2015 16:44
Show Gist options
  • Save theduke/6bfa46738f679f036712 to your computer and use it in GitHub Desktop.
Save theduke/6bfa46738f679f036712 to your computer and use it in GitHub Desktop.
Nim bindSym test
import macros
proc myEcho() =
echo("myEcho")
macro m1(body: stmt): stmt =
result = newNimNode(nnkStmtList)
result.add(newCall(bindSym("myEcho", rule=brOpen)))
m1():
discard
proc test1() =
proc myEcho() = echo("customEcho")
m1():
discard
test1()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment