-
-
Save ReneSac/a638e1f9d3da866e1f55 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
| proc optarg(x:int, y:int=0):int = x + y | |
| proc optarg2(x:int, y:int=0, z:int=0):int = x + y - z | |
| proc singlearg(x:int):int = 20*x | |
| echo optarg 1, optarg 2, singlearg 2 # prints 1240 | |
| echo optarg2 1, optarg2 2, singlearg 2 # prints 1240 | |
| echo optarg2(1, optarg2(2, singlearg 2)) # prints 43 | |
| echo 1.optarg 2.optarg, singlearg 2 # prints 340 | |
| echo 1.optarg2 2.optarg2, singlearg 2 # prints 340 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment