Check out this [hack](https://play.nim-lang.org/?gist=cc87d451c7338247e4daf475cde2ca1b): template testScope = template ret = return when compiles(ret()): echo "Function" else: echo "Wild West" proc test = testScope() test() testScope()
_Not fully tested_
