Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOP] mop:class-slots doesn't return a set of slot definitions for structure-class #579

Open
bohonghuang opened this issue May 1, 2023 · 1 comment

Comments

@bohonghuang
Copy link

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.

@easye
Copy link
Collaborator

easye commented Aug 18, 2023

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants