Tutorial by Examples

Variadic functions are created using the ... ellipses syntax in the argument list of the function definition. function id(...) return end If you called this function as id(1, 2, 3, 4, 5) then ... (AKA the vararg list) would contain the values 1, 2, 3, 4, 5. Functions can take required arg...
As stated in the basic examples, you can have variable bound arguments and the variable argument list (...). You can use this fact to recursively pull apart a list as you would in other languages (like Haskell). Below is an implementation of foldr() that takes advantage of that. Each recursive call ...

Page 1 of 1