Currently user defined functions can only specify a fixed number of parameters:
fn foo(a, b, c) { ... }
We should at least support optional function parameters and possibly also variadic functions.
Example syntax for optional parameters:
fn dump(value, pretty = false) { ... }
"?" syntax like in TypeScript (e.g. pretty?) is not a good idea here, i think.
The only fitting default value would be null (i do not want an undefined construct exposed to the language).
Currently user defined functions can only specify a fixed number of parameters:
We should at least support optional function parameters and possibly also variadic functions.
Example syntax for optional parameters:
"?" syntax like in TypeScript (e.g.
pretty?
) is not a good idea here, i think. The only fitting default value would benull
(i do not want an undefined construct exposed to the language).