Rev 71 | Blame | Compare with Previous | Last modification | View Log | RSS feed
irasnyd@duallie lisp $ cat hw10.lisp
;Written By: Ira Snyder
;Due Date: 02-21-2005
;Homework #: HW10 (Exercise #15)
(defmacro ZERO* (&rest VARS)
(do ((VARS VARS (cdr VARS))
(RET nil))
((null VARS) (cons 'progn RET))
(setf RET (cons `(setf ,(car VARS) 0) RET))
)
)
irasnyd@duallie lisp $ clisp -q
[1]> (load 'hw10.lisp)
;; Loading file hw10.lisp ...
;; Loaded file hw10.lisp
T
[2]> x
*** - EVAL: variable X has no value
The following restarts are available:
STORE-VALUE :R1 You may input a new value for X.
USE-VALUE :R2 You may input a value to be used instead of X.
Break 1 [3]> abort
[4]> (zero* x)
0
[5]> x
0
[6]> (setf x 10 y 20 z 30)
30
[7]> (zero* x y z)
0
[8]> x
0
[9]> y
0
[10]> z
0
[11]> (bye)
irasnyd@duallie lisp $