apply builtin: (apply f args) will call f passing the arguments from the args list. For example, (apply (lambda (x y) (+ x y)) (list 1 2))
Support for &rest parameters in function definitions, allowing for variadic functions. For example, (lambda (x &rest y) ...)
There is some unfortunate code duplication in apply, but this solution is better (in terms of columns and code complexity) for now. We might be able to simplify the duplication out in the future.
This PR adds:
apply
builtin:(apply f args)
will callf
passing the arguments from theargs
list. For example,(apply (lambda (x y) (+ x y)) (list 1 2))
&rest
parameters in function definitions, allowing for variadic functions. For example,(lambda (x &rest y) ...)
There is some unfortunate code duplication in
apply
, but this solution is better (in terms of columns and code complexity) for now. We might be able to simplify the duplication out in the future.Manual update: https://github.com/argumentcomputer/user-manual/pull/24