Skip to content

Commit

Permalink
added get-slot-value which elides boundedness errors and supports cal…
Browse files Browse the repository at this point in the history
…ling with slot-defs
  • Loading branch information
bobbysmith007 committed Sep 20, 2013
1 parent a523ef4 commit d478fe3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions access.lisp
Expand Up @@ -8,6 +8,7 @@
#:has-reader?
#:has-writer?
#:has-slot?
#:get-slot-value
#:ensure-slot-name
#:class-of-object
#:class-slot-by-name
Expand Down Expand Up @@ -282,6 +283,11 @@
(when (listp writer-name)
(has-writer? o (second writer-name)))))))

(defun get-slot-value (o sn)
"like slot-value but without boundedness errors and works with slot definitions"
(setf sn (ensure-slot-name sn))
(and (slot-boundp o sn) (slot-value o sn)))

(defun has-slot? (o slot-name &key (lax? t))
"Does o have a slot names slot-name
Expand Down

0 comments on commit d478fe3

Please sign in to comment.