Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Deco
Created February 15, 2015 08:27
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 Deco/0827f2e27dda2cc5fcd2 to your computer and use it in GitHub Desktop.
Save Deco/0827f2e27dda2cc5fcd2 to your computer and use it in GitHub Desktop.
import sequtils
template test(x: int; list: varargs[int]): expr =
foldl(list, a*(b+x))
echo test(5, 1, 2, 3, 4) # 504
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment