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
This commit is contained in:
parent
bc2eb0ea9b
commit
6216046bc6
6 changed files with 34 additions and 70 deletions
12
tests/compile/tgensym.nim
Normal file
12
tests/compile/tgensym.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
template hygienic(val: expr) =
|
||||
var `*x` = val
|
||||
stdout.write `*x`
|
||||
|
||||
var x = 100
|
||||
|
||||
hygienic 1
|
||||
hygienic 2
|
||||
hygienic 3
|
||||
|
||||
echo x
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue