Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro defalias-tmp (aliases &rest body )
- (let (defs pre post)
- (loop for (from to) in aliases
- do
- (if (fboundp from)
- (let ((tmp (gensym "original-")))
- (push `(defalias ',tmp ',from) pre)
- (push `(defalias ',from ',tmp) post)
- (push `(fmakunbound ',tmp) post))
- (push `(fmakunbound ',from) post))
- collect `(defalias ',from ,to) into defs
- finally
- (return
- `(progn
- ,@pre
- ,@defs
- (prog1 (progn ,@body)
- ,@(reverse post)))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement