abcl
abcl copied to clipboard
[MOP] `mop:class-slots` doesn't return a set of slot definitions for `structure-class`
Hi! I'm trying to introspect structure types through MOP in ABCL. The following code:
(defstruct test
a b c)
(mapcar #'mop:slot-definition-type (mop:class-slots (find-class 'test)))
is expected to return (A B C), but ABCL emits an error:
The value #(SYSTEM::DEFSTRUCT-SLOT-DESCRIPTION A 0 TEST-A NIL T
NIL) is not of type #<STANDARD-CLASS SYSTEM:SLOT-DEFINITION {236E0674}>.
[Condition of type SIMPLE-TYPE-ERROR]
The return value of calling mop:class-slots on a structure-class seems to be a list of vectors that contains slot descriptions, instead of a list of slot definitions.
Different condition on abcl-1.9.3-dev, but still a problem.
CL-USER> (defstruct test
a b c)
STYLE-WARNING: redefining MAKE-TEST at top level
STYLE-WARNING: redefining TEST-P at top level
STYLE-WARNING: redefining COPY-TEST at top level
TEST
CL-USER> (mapcar #'mop:slot-definition-type (mop:class-slots (find-class 'test)))
; Evaluation aborted on #<STORAGE-CONDITION {47EA3766}>.
CL-USER> (lisp-implementation-version)
"${abcl.version}-git-c3feba71"
"OpenJDK_64-Bit_Server_VM-MacPorts-17.0.8+7"
"aarch64-Mac_OS_X-13.5.1"