Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (labels ((mapatoms (function tree)
- (cond
- ((atom tree)
- (funcall function tree))
- ((consp tree)
- (cons (mapatoms function (car tree))
- (mapatoms function (cdr tree)))))))
- (mapatoms (lambda (atom)
- (format t "~A~%" atom))
- '(defmacro (x) `(list ,x))))
- ;; output:
- ;; DEFMACRO
- ;; X
- ;; NIL
- ;; QUASIQUOTE
- ;; LIST
- ;; ,X
- ;; NIL
- ;; NIL
- ;; NIL
- ;; (NIL (NIL) (NIL (NIL NIL)))
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement