In XLISP, there are several times that you define a formal argument list
for a body of code [like
(defun my-add ; define function MY-ADD
(num1 &rest num-list &aux sum) ; with 1 arg, rest, 1 aux var
(setq sum num1) ; clear SUM
(dotimes (i (length num-list) ) ; loop through rest list
(setq sum (+ sum (car num-list))) ; add the number to sum
(setq num-list (cdr num-list))) ; and remove num from list
sum) ; return sum when finished
(my-add 1 2 3 4) ; returns 10
(my-add 5 5 5 5 5) ; returns 25
(defun more-keys ; define MORE-KEYS
( a ; with 1 parameter A
&aux b ; with local var B
(c 99) ; local var C= 99
(d T) ) ; local var D= T
(format T "a=~a " a) ; body of the function
(format T "b=~a " b)
(format T "c=~a " c)
(format T "d=~a " d))
(more-keys "hi") ; prints a=hi b=NIL c=99 d=T
See the