You do it like this: template mytempl(prefix) = proc `prefix World`() = echo "hello world" Run
See here: [https://nim-lang.github.io/Nim/manual.html#templates-identifier-construction](https://nim-lang.github.io/Nim/manual.html#templates-identifier-construction)