From bcbf783688a26bfa99204deb71c3da5e4fddee79 Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Mon, 8 Dec 2003 11:06:23 +0000 Subject: [PATCH] slot-exists-p now works with structures --- src/clos/builtin.lsp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/clos/builtin.lsp b/src/clos/builtin.lsp index 010703ecc..9ff38f8ad 100644 --- a/src/clos/builtin.lsp +++ b/src/clos/builtin.lsp @@ -66,6 +66,15 @@ (princ ")" stream) obj)) +(defmethod slot-exists-p ((obj structure-object) slot-name) + (let ((class (si:instance-class obj))) + ;(declare (type structure-class class)) + ;; FIXME! NIL could, in principle, be valid slot name. We reject it here + ;; because DEFSTRUCT uses this name to mark padding slots for initial-offset. + (and slot-name + (member slot-name (slot-value class 'slots) :key #'slotd-name) + t))) + ;;; ====================================================================== ;;; Built-in classes ;;; ----------------------------------------------------------------------