From ffdcc3c6154aa5a77314e240621ff10a3e6c26e3 Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 16 Sep 2023 10:06:21 -0700 Subject: Initial commit --- README.org | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 README.org (limited to 'README.org') diff --git a/README.org b/README.org new file mode 100644 index 0000000..3f845ac --- /dev/null +++ b/README.org @@ -0,0 +1,47 @@ +* forget + +Forget things about symbols. Handy during interactive development. + +The `forget` function will forget function bindings, symbol bindings, +and class bindings. It will also unintern a symbol from its home package. + +The `forget` function can forget packages too, but you must pass +`:package? t` as an argument. + +Any of the default options can be turned off by passing `nil` to the +appropriate option. E.g. if you wanted to forget everything but not +unintern the symbol, you'd pass `:intern? nil`. + +Example: + +#+begin_src lisp +CL-USER> (defvar unremarkable "hey") +UNREMARKABLE + +CL-USER> (defun unremarkable () "hey") +UNREMARKABLE + +CL-USER> (defclass unremarkable () ()) +# + +CL-USER> (setf (get 'unremarkable :hey) "you") +"you" + +CL-USER> (defpackage :unremarkable (:use #:cl)) +# + +CL-USER> (forget:forget 'unremarkable) +WARNING: Unbinding function UNREMARKABLE +WARNING: Unbinding value UNREMARKABLE +WARNING: Unbinding class UNREMARKABLE +WARNING: Dropping symbol-plist on UNREMARKABLE +WARNING: Uninterning UNREMARKABLE from "COMMON-LISP-USER" +NIL + +CL-USER> (forget:forget 'unremarkable :package? t) +WARNING: Uninterning UNREMARKABLE from "COMMON-LISP-USER" +WARNING: Deleting package "UNREMARKABLE" +T +CL-USER> + +#+end_src -- cgit v1.2.3