Nim/tests/compile/tgensym.nim
Zahary Karadjov 6216046bc6 genSym support for hygienic macros and templates.
example:
template hygienic(val: expr) =
  var `*x` = val
  echo `*x`

*x was chosen as mnemonic for "opposite of public" and thus private
2012-03-26 04:36:26 +03:00

12 lines
124 B
Nim

template hygienic(val: expr) =
var `*x` = val
stdout.write `*x`
var x = 100
hygienic 1
hygienic 2
hygienic 3
echo x