Created
August 29, 2011 19:03
-
-
Save zah/1179131 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template repeatStmt(N: int, code: stmt) : stmt = | |
when N > 0: | |
code | |
repeatStmt(N-1, code) | |
template repeatTemplate(N: int, tmpl: expr) : stmt = | |
when > 0: | |
tmpl(N) | |
repeatTemplate(N-1, tmpl) | |
template createOverload(N: int) = | |
# magically create overload here for tuple with 3 fields | |
repeatTemplate(10, createOverload) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment