[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: getting the names of clos object slots



  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))))