diff options
author | colin <colin@cicadas.surf> | 2023-09-09 11:09:10 -0700 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2023-09-09 13:59:36 -0700 |
commit | 4025722943ae814c88da1fa8fe5778cffecce4ad (patch) | |
tree | 12ca12b13dc53913eab33d61e5c7eeea946699e0 /src/standard-hooks.lisp | |
parent | 1bb8d1f8826e21314aae0a96dc25d088afad36f5 (diff) |
Testiere2
Add examples
changed some internal names; improved some error messages
Added more examples
renaming exports
Added New Readme
Diffstat (limited to 'src/standard-hooks.lisp')
-rw-r--r-- | src/standard-hooks.lisp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/standard-hooks.lisp b/src/standard-hooks.lisp new file mode 100644 index 0000000..fcf1367 --- /dev/null +++ b/src/standard-hooks.lisp @@ -0,0 +1,68 @@ +;;;; standard-hooks.lisp -- built-in hooks for standard def* macros + +(in-package :testiere) + +;;; DEFSTRUCT + +;; (defstruct moo +;; #+testiere +;; (:tests ...) +;; a b c) + +(register-hook + 'cl:defstruct + #'standard-extractor) + +;;; DEFCLASS + +;; (defclass fooar () +;; (slots...) +;; #+testiere +;; (:tests ...)) + +(defun defclass-restarts-expander (form) + (let ((name (second form))) + `((make-unbound + () + (setf (find-class ',name) nil))))) + +(register-hook + 'cl:defclass + #'standard-extractor + #'defclass-restarts-expander) + +;;; DEFMETHOD + +;; (defmethod okwhat ((x moo) (y bar) z) +;; "Here's a method" +;; #+testiere +;; (:tests ...) +;; (flah (moo-blah x) (barbar y))) + +(register-hook 'cl:defmethod #'standard-extractor) + +;;; DEFUN + +;; (defun add3 (x y z) +;; "Adds three thigns" +;; #+testiere +;; (:tests ...) +;; (+ x y z)) + +(defun defun-restarts-expander (form) + (let ((name (second form))) + `((make-unbound + () + (fmakunbound ',name))))) + +(register-hook 'cl:defun #'standard-extractor #'defun-restarts-expander) + +;;; DEFTYPE + +;; (deftype optional-number () +;; "Its a number, or not" +;; #+testiere +;; (:tests ...) +;; `(or number null)) + +(register-hook 'cl:deftype #'standard-extractor) |