(defclass a () ()) (eval-when (:compile-toplevel) (defmacro test (&environment env) (print (find-class 'a NIL env))) (test)) ;; (compile-file this) ; compiling file "/home/linus/a.lisp" (written 30 OCT 2018 04:39:40 PM): ; compiling (DEFCLASS A ...) ; file: /home/linus/a.lisp ; in: EVAL-WHEN (:COMPILE-TOPLEVEL) ; (EVAL-WHEN (:COMPILE-TOPLEVEL) ; (DEFMACRO TEST (&ENVIRONMENT ENV) (PRINT (FIND-CLASS 'A NIL ENV))) ; (TEST)) ; ; caught STYLE-WARNING: ; The variable ENV is defined but never used. NIL ;;; But according to http://www.lispworks.com/documentation/HyperSpec/Body/m_defcla.htm : ;;; ;;; "The compiler must make the class definition available to be returned by find-class when its environment argument is a value received as the environment parameter of a macro."