Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
proc foo: iterator =
template x = echo y # undeclared identifier error
return iterator =
let y = "foo"
x
proc bar: auto =
template x = echo y # no error
return iterator =
let y = "bar"
x
discard foo()
discard bar()
Is this really a bug? Works with mixin y, as far as I can tell auto is just delaying semantic checking of x. There's really no guideline on when mixin has to be used and when it shouldn't.
(tried in version 0.20)