Subversion Repositories programming

Rev

Rev 71 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
71 irasnyd 1
irasnyd@duallie lisp $ cat hw10.lisp 
2
;Written By: Ira Snyder
3
;Due Date:   02-21-2005
4
;Homework #: HW10 (Exercise #15)
5
 
6
(defmacro ZERO* (&rest VARS)
7
  (do ((VARS VARS (cdr VARS))
8
       (RET nil))
9
      ((null VARS) (cons 'progn RET))
10
    (setf RET (cons `(setf ,(car VARS) 0) RET))
11
  )
12
)
13
 
14
irasnyd@duallie lisp $ clisp -q
15
 
16
[1]> (load 'hw10.lisp)
17
;; Loading file hw10.lisp ...
18
;; Loaded file hw10.lisp
19
T
20
[2]> x
21
 
22
*** - EVAL: variable X has no value
23
The following restarts are available:
24
STORE-VALUE    :R1      You may input a new value for X.
25
USE-VALUE      :R2      You may input a value to be used instead of X.
26
 
27
Break 1 [3]> abort
28
 
29
[4]> (zero* x)
30
 
31
[5]> x
32
 
33
[6]> (setf x 10 y 20 z 30)
34
30
35
[7]> (zero* x y z)
36
 
37
[8]> x
38
 
39
[9]> y
40
 
41
[10]> z
42
 
43
[11]> (bye)
44
irasnyd@duallie lisp $ 
45