Skip to content

Instantly share code, notes, and snippets.

@Araq
Created March 20, 2020 13:50
Show Gist options
  • Save Araq/69355d41f1c2d3dae461bade4e8d0591 to your computer and use it in GitHub Desktop.
Save Araq/69355d41f1c2d3dae461bade4e8d0591 to your computer and use it in GitHub Desktop.
{.push staticBoundChecks: on.}
proc takeNat(n: Natural) =
discard
proc p(a: openArray[int]) =
if a.len > 0:
echo a[0]
for i in 0..a.len-8:
echo a[i]
takeNat(a.len - 4)
{.pop.}
p([1, 2, 3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment