Skip to content

Instantly share code, notes, and snippets.

@Deco
Created February 15, 2015 08:27

Revisions

  1. Deco created this gist Feb 15, 2015.
    9 changes: 9 additions & 0 deletions gistfile1.nim
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@

    import sequtils

    template test(x: int; list: varargs[int]): expr =
    foldl(list, a*(b+x))


    echo test(5, 1, 2, 3, 4) # 504