;;;; forget.lisp (in-package #:forget) (defun forget (symbol &key (function? t) (value? t) (class? t) (plist? t) (interns? t) (package? nil)) "Uninterns and forgets everything about a symbol" (assert (symbolp symbol) (symbol) "~s is not a symbol." symbol) (when (and function? (fboundp symbol)) (warn "Unbinding function ~s" symbol) (fmakunbound symbol)) (when (and value? (boundp symbol)) (warn "Unbinding value ~s" symbol) (makunbound symbol)) (when (and class? (find-class symbol nil)) (warn "Unbinding class ~s" symbol) (setf (find-class symbol) nil)) (when (and plist? (symbol-plist symbol)) (warn "Dropping symbol-plist on ~s" symbol) (setf (symbol-plist symbol) nil)) (when interns? (warn "Uninterning ~s from ~s" symbol (package-name (symbol-package symbol))) (unintern symbol (symbol-package symbol))) (when (and package? (find-package symbol)) (warn "Deleting package ~s" (package-name (find-package symbol))) (delete-package (find-package symbol))))