> I tested with 0.16.1. With current 0.17.1
I used 0.17.0 (stable), same behavior. So now we now what Nim does here:
* _do_ is auto-converted to _do ()_
* The following block does **not** automatically form a scope of its own
The second point is corroborated by the fact that bluenote's first example does
compile when I add explicit _block_ statements to force a scope.
import future
proc takesFunc(f: () -> void) =
f()
takesFunc do:
block:
var x = 1
takesFunc do:
block:
var x = 1
And I really don't like that. If it becomes a procedure, making its body a
scope would seem more intuitive to me.
By the way, there seem to be two different ideas of "block" in Nim, an unscoped
and a scoped one. See the manual section "Passing a code block to a template".
The whole _typed_ vs _untyped_ thing only makes sense when blocks without an
explicit _block_ statement are unscoped.