fix macro
This commit is contained in:
12
lib/lib.lisp
12
lib/lib.lisp
@@ -3,12 +3,6 @@
|
||||
|
||||
(defun list (x . y) (cons x y))
|
||||
|
||||
(macro and (expr . rest)
|
||||
(if rest (list 'if expr (cons 'and rest)) expr))
|
||||
|
||||
(macro cond (expr. rest)
|
||||
(if rest (list 'if (car expr) (car (cdr expr)) (cons 'cond rest))
|
||||
expr))
|
||||
|
||||
;exampe (cond ((== 1 0) 0) ((== 1 1) -1) (+ 100000000))
|
||||
;exampe (cond ((== 1 0) 0) ((== 1 0) -1) (+ 100000000))
|
||||
(macro cond (expr . rest)
|
||||
(if (not expr) nil
|
||||
`(if ,(car expr) (progn ,@expr) (cond ,@rest))))
|
||||
|
||||
Reference in New Issue
Block a user