Skip to content

Instantly share code, notes, and snippets.

@Araq
Created June 3, 2016 18:11
Show Gist options
  • Select an option

  • Save Araq/874f689a22fa2375ffee9335a0ac32d0 to your computer and use it in GitHub Desktop.

Select an option

Save Araq/874f689a22fa2375ffee9335a0ac32d0 to your computer and use it in GitHub Desktop.
template ov1(a: int; b: untyped; s1: untyped) =
let b = 10
if a != 0:
s1
template ov1(a: int; b: untyped; s1, s2: untyped) =
let b = 11
if a != 0:
s1
else:
s2
proc gen[T](x: T) =
ov1(0, foobar) do:
echo foobar
do:
echo foobar+10
gen(20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment