Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
17
Task/Function-prototype/Nim/function-prototype.nim
Normal file
17
Task/Function-prototype/Nim/function-prototype.nim
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Procedure declarations. All are named
|
||||
proc noargs(): int
|
||||
proc twoargs(a, b: int): int
|
||||
proc anyargs(x: varargs[int]): int
|
||||
proc optargs(a, b: int = 10): int
|
||||
|
||||
# Usage
|
||||
discard noargs()
|
||||
discard twoargs(1,2)
|
||||
discard anyargs(1,2,3,4,5,6,7,8)
|
||||
discard optargs(5)
|
||||
|
||||
# Procedure definitions
|
||||
proc noargs(): int = echo "noargs"
|
||||
proc twoargs(a, b: int): int = echo "twoargs"
|
||||
proc anyargs(x: varargs[int]): int = echo "anyargs"
|
||||
proc optargs(a: int, b = 10): int = echo "optargs"
|
||||
Loading…
Add table
Add a link
Reference in a new issue