Skip to content

Instantly share code, notes, and snippets.

@narimiran
Created September 5, 2017 17:02
Show Gist options
  • Save narimiran/c3b9179b82380e17f0b4b98a1acf0ef2 to your computer and use it in GitHub Desktop.
Save narimiran/c3b9179b82380e17f0b4b98a1acf0ef2 to your computer and use it in GitHub Desktop.
proc `[]`[T](s: openarray[T], start: int, stop: int, step: int): seq[T] =
result = newSeq[T]()
for i in countup(start, stop, step):
result.add(s[i])
let x = toSeq(0..20)
echo x[3, 13, 2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment