Created
May 18, 2013 20:41
-
-
Save fowlmouth/5605720 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 | |
macro foo: stmt = | |
var y = newIntLitNode(0) | |
result = quote do: | |
let x = `y` | |
result.treerepr.echo | |
if result[0][0][0].kind != nnkIdent: | |
quit "Invalid node kind "& $result[0][0][0].kind | |
foo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, Google search of "qote in nim" brought me here. But cant understand anything from this code. Could you please post some explanations about this code ?