@Udiknedormin Here you can use `static` types that passes data to macros
instead of a `NimNode`
import macros
const module {.strdefine.}: string = "math"
macro importconst(name: static[string]): untyped =
#let value = name.symbol.getImpl
#echo "variable name: ", name.repr
#echo "default value: ", $value
result = newNimNode(nnkImportStmt).add(newIdentNode(name))
static:
echo "actual value: ", module
importconst(module)
- Re: Import module by name / absolute path Araq
- Re: Import module by name / absolute path c0ntribut0r
- Re: Import module by name / absolute path Udiknedormin
- Re: Import module by name / absolute path guibar
- Re: Import module by name / absolute path Udiknedormin
