type SeqView[T] = object
data: ref seq[T]
bounds: Slice[int]
proc box[T](x: T): ref T =
new(result); result[] = x
iterator items[T](sv: SeqView[T]): T =
for pos in sv.bounds:
yield sv.data[pos]
var
seq1 = @[1, 2, 3, 4, 5, 6]
sv = SeqView[int](data: box(seq1), bounds: 2..4)
for el in sv:
echo el