Skip to content

Instantly share code, notes, and snippets.

@fowlmouth
Created May 18, 2013 20:41
Show Gist options
  • Save fowlmouth/5605720 to your computer and use it in GitHub Desktop.
Save fowlmouth/5605720 to your computer and use it in GitHub Desktop.
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()
@kcvinker
Copy link

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment