• chevron_right

    Condition constructors in Common Lisp

    Michał "phoe" Herda · Sunday, 23 December, 2018 - 12:04 edit

(This is a repost of an old blog post of mine from Teknik.)

#common-lisp #clos #conditions

TIL that I can do:

(define-condition my-condition () ())
(defmethod initialize-instance :after ((warning my-condition) &key)
  (print "boo"))

The works on SBCL*, CCL, ECL, ABCL, CLISP.

*You need to use MAKE-INSTANCE instead of MAKE-CONDITION to make the constructor fire on SBCL. See