I want to do something like:
var x = 2 @[1..x]
to give me @[1,2], but it gives me @[(a: 1, b: 2)]
You could use to_seq() from the sequtils module:
import sequtils
var
x = to_seq(1..2)
y = to_seq(40..60)
echo repr(x)
# 0x101d60050[1, 2]
echo repr(y)
# 0x101d63050[40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60]