Open Mercerenies opened 2 years ago
Currently, we compile optional arguments to ordinary GDScript arguments, so
(defn foo (&opt y))
compiles to
func foo(y_0): return null
where we fill in the null default argument at every call site automatically.
null
We could compile to
func foo(y_0 = null): return null
to maximize compatibility with GDScript call signatures.
Consider how this interacts with functions that have both an optional and a rest (or array) argument.
Upon further consideration, I've decided to defer this to v2.0.
Currently, we compile optional arguments to ordinary GDScript arguments, so
compiles to
where we fill in the
null
default argument at every call site automatically.We could compile to
to maximize compatibility with GDScript call signatures.
Consider how this interacts with functions that have both an optional and a rest (or array) argument.