Skip to content

Instantly share code, notes, and snippets.

@def-
Created September 5, 2017 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save def-/b2a308b705865ad182121df0a4688cfd to your computer and use it in GitHub Desktop.
Save def-/b2a308b705865ad182121df0a4688cfd to your computer and use it in GitHub Desktop.
import sequtils
proc `[]`[T](s: openarray[T], x: int, y: Slice[int]): seq[T] =
result = newSeq[T]()
for i in countup(x, y.b, y.a - x):
result.add(s[i])
let x = toSeq(0..20)
echo x[3,5..13]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment