[Sbcl-help] defmacro / find-class

0 views
Skip to first unread message

syll-dev via Sbcl-help

unread,
Mar 12, 2023, 12:24:28 PM3/12/23
to sbcl
Hello

The following code does run correctly in a file loaded with (load
"code.lisp") but not in a project using asdf.

(defmacro m (class-name)
(let* ((class (find-class class-name))
(slots (progn
(unless (sb-mop:class-finalized-p class)
(sb-mop:finalize-inheritance class))
(mapcar #'sb-mop:slot-definition-name (sb-mop:class-
slots class)))))
`(print ',slots)))

(defclass c ()
(a
b))

(m c)

find-class does not find the class. Probably the same bug that is
described here ?
https://bugs.launchpad.net/sbcl/+bug/1669030
https://bugs.launchpad.net/sbcl/+bug/310120
https://bugs.launchpad.net/sbcl/+bug/309140

Is there another way to access the class in the macro without separating
defclass et the use of the macro in two files ?

syll



_______________________________________________
Sbcl-help mailing list
Sbcl...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Reply all
Reply to author
Forward
0 new messages