@Udiknedormin Thanks, you code works! Actually I was using this: template scope(body : typed) : auto = (block: body)
but I guess ther is something I miss about the semantics of typed because this code template scope(body : typed) : auto = (block: body) let c = scope: let b = 5 1 echo b prints 5. Without the type of the template parameter the scoping works instead. I read the documentation about typed vs untyped [here](https://nim-lang.org/docs/manual.html#templates-typed-vs-untyped-parameters) but this remains quite obscure to me.