-
-
Save ReneSac/d14e00e60dfe052ebd10 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 maybeMod(x: Tinteger, module:Natural) = | |
| when module > 0: x mod module | |
| else: x | |
| let a = 1.maybeMod(0) # Error: value returned by statement has to be discarded | |
| proc foo(a,b) = | |
| generalFoo(a,b) | |
| template generalFoo(a,b,c=0) | |
| a.maybeMod(c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment