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)
- (read-from-string (format nil "~S" atom)))
- '(defmacro (x) `(list ,x))))
- ;; output:
- ;; DEFMACRO
- ;; X
- ;; NIL
- ;; QUASIQUOTE
- ;; LIST
- ;; ,X
- ;;
- ;; Comma not inside a backquote.
- ;;
- ;; Stream: #<dynamic-extent STRING-INPUT-STREAM (unavailable) from ",X">
- ;; [Condition of type SB-INT:SIMPLE-READER-ERROR]
- ;;
- ;; Restarts:
- ;; 0: [RETRY] Retry SLIME REPL evaluation request.
- ;; 1: [*ABORT] Return to SLIME's top level.
- ;; 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1002B59D33}>)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement