I am trying to learn Nim and its features, such Iterators; and I found that the following example works fine.
for i in countup(1,10):
echo($i)
However, the following does not work:
var
counter = countup(1,10)
for i in counter :
echo($i)
The Nim compiler reports the following error:
Error: attempt to call undeclared procedure: "countup"
How is an undeclared procedure counted, where is the built-in iterator !?
Or is this a bug that needs to be reported?
What are the solutions for enforcing a custom iterator in a variable declaration, such a count, or a countdown?
NOTE. I am using Nim 0.13.0 on a Windows platform.
source
share