Guest User

Untitled

a guest
May 18th, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nim 0.39 KB | None | 0 0
  1. # THIS USED TO WORK
  2. macro test*(args: untyped): untyped =
  3.   result = newStmtList()
  4.  
  5.   for name in args:
  6.     # Add quote directly
  7.     add result, quote do:
  8.       test `name`
  9.      
  10. # NOT ANYMORE
  11. macro test*(args: untyped): untyped =
  12.   result = newStmtList()
  13.  
  14.   for name in args:
  15.     # Need to assign first to a variable
  16.     let t = quote do:
  17.       test `name`
  18.      
  19.     add result, t
Advertisement
Add Comment
Please, Sign In to add comment