In XLISP, there are several times that you define a formal argument list
for a body of code like
(defun foo ; define function FOO
(a &optional b (c 1) ) ; with some optional args
(print a) (print b) (print c))
(foo) ; error: too few arguments
(foo 1) ; prints 1 NIL 1
(foo 1 2) ; prints 1 2 1
(foo 1 2 3) ; prints 1 2 3
(defun fee ; define function FEE
(a &optional (b 9 b-passed) ) ; with some optional args
(print a) (print b)
(if b-passed (print "b was passed")
(print "b not passed")))
(fee 1) ; prints 1 9 "b not passed"
(fee 1 2) ; prints 1 2 "b was passed"
See the
&optional
keyword in the