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): # Or its equivalent 'for i in 1..10:'
echo($i)
However, The following do not works:
var
counter = countup(1,10) # THIS DO NOT WORK !
# counter = 1..10 # This works
for i in counter :
echo($i)
The Nim Compiler reports the following error :
Error: attempting to call undeclared routine: 'countup'
How countup is undeclared routine , where it is a built-in iterator !?
Or it is a bug to report about ?
What are the solutions to enforce a custom iterator in variable declaration, such countup or countdown ?
NOTE: I am using Nim 0.13.0 on Windows platform.