Title here
Summary here
Variadic functions can be called with any number of trailing arguments. For example, fmt.Println
is a common variadic function.
Here’s a function that will take an arbitrary number of int
s as arguments:
To run the program, save the code to a file with a .nim
extension (e.g., variadic_functions.nim
) and use Nim’s command-line tools to execute it.
Another key aspect of functions in Nim is their ability to form closures, which we’ll look at next.
Next example: Closures.