Something like this works:
var verbose = false
template globalVerbose: untyped =
bind verbose
verbose
proc foo(verbose: bool) =
globalVerbose = true
foo(false)
echo verbose
Run
- Silly scope shadowing question Hlaaftana
- Silly scope shadowing question Araq
- Silly scope shadowing question halloleo
