Reputation: 20648
Is there a way to accept arbitrary number of arguments with procedure in Nim?
Example if i want to get sum of multiple arguments, it would look something like this
proc sum_all(x,y,z: int): int {.discardable.} =
return x+y+z
In Python it would look something like this
def sum_all(*args):
return sum(args)
Upvotes: 2
Views: 343