Nim says array[] expects two type paremters usually meaning the 0..n and the type. How can this be?
What do I do?
You can use the openarray specifier for procs.
proc doSomething(arr: openArray[int])=
for x in arr:
echo x
var
myArr: array[4, int] = [1,2,3,4]
mySeq: seq[int] = @[5,6,7,8]
doSomething(myArr)
doSomething(mySeq)
# Outputs:
# 1
# 2
# 3
# 4
# 5
# 6
# 7
# 8