`ident` as you use it is not deprecated. It's actually prefered to its alias
`newIdentNode`.
The `ident` that is deprecated is probably linked to the `NimIdent` type which
has been deprecated.
If you can, use `bindSym`, it will bind the identifier with what is visible in
the module of the macro. Using `ident` instead will bind the identifier with
what is visible at the call site of the macro. Ident is useful if you want to
do (compile-time) late-bindings.
Example of when you would want to use bindSym:
# File ex_macro.nim
import macros
proc private_foo() =
echo "I'm foo"
macro wrap_foo_ident*(): untyped =
result = newCall(ident"private_foo") # Error: undeclared identifier:
'private_foo'
macro wrap_foo_bindsym*(): untyped =
result = newCall(bindSym"private_foo")
Run
# file ex_usage.nim
import ./ex_macro
# wrap_foo_ident()
wrap_foo_bindsym()
Run
Example on late bindings coming.