I would like to specify a sequence directly from a slice (rather than iterating through the slice and adding each element individually to the sequence). I've tried a few different ways but the obvious ones don't seem to work.
var
x = newSeq(1..n)
y: seq[int] = @[1..n]
z: seq[int] = 1..n
The only thing I've managed to get to work is importing list comprehensions from future
var x: seq[int] = lc[x | (x <- 1..n), int]
I can't find any way in the docs that this can be done that doesn't involve importing the experimental stuff from future or overloading the sequence constructor myself.