DEFINE-CONDITION performs load-time effect at compile-time

Bug #1550070 reported by Douglas Katzman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Undecided
Unassigned

Bug Description

foo.lisp:
===
(eval-when (:compile-toplevel)
  (assert (not (sb-kernel:find-classoid 'what nil))))

(define-condition what (warning) ())

(defmacro should-this-work-or-not ()
  (print (make-condition 'what))
  '(+ 1 2))

(defun baz () (should-this-work-or-not))
===

* (compile-file "/tmp/foo.lisp")
print #<WHAT {1002B33B43}>

This is a minor issue, but is an obvious inconsistency with how DEFSTRUCT and DEFCLASS work, where there is a clear distinction between the effect of compiling the form versus loading the form.

Revision history for this message
Stas Boukarev (stassats) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.