[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
re: getting the names of clos object slots
- To: dxs@evolving.com
- Subject: re: getting the names of clos object slots
- From: donc@ISI.EDU (Don Cohen)
- Date: Fri, 20 Jan 95 15:26:50 -0800
- Cc: <clisp-list@ma2s2.mathematik.uni-karlsruhe.de>
- Posted-date: Fri, 20 Jan 95 15:26:50 -0800
is there a way of getting the names of the slots in a clos object?
No advertised way, but look at the plist of the symbol that names the
defstruct.
While we're at it, there's genuinely NO way to figure out from the
structure name and the slot name what the accessor is.
Here is my local fix to a similar problem:
(progn
(unless (fboundp 'old-ds-make-accessors)
(setf (symbol-function 'old-ds-make-accessors)
(symbol-function 'system::ds-make-accessors)))
(lisp:defun new-ds-make-accessors (name type concname slotlist)
(cons `(setf (get ',name 'concname) ',concname)
(old-ds-make-accessors name type concname slotlist)))
(setf (symbol-function 'system::ds-make-accessors)
(symbol-function 'new-ds-make-accessors))
(lisp:defun defstruct-access-function-name (structname slotname)
(intern (concatenate 'string (get structname 'concname)
(symbol-name slotname))
(symbol-package structname))))