Slots BOUNDP and UNBOUND in class effective-virtual-slot-definition

Chisheng Huang <[email protected]> Sat, 26 May 2007 13:00:35 -0700 (PDT)
Newsgroups gmane.lisp.clg.devel
Message-ID <[email protected]>
Hi,

The usage of the BOUNDP slot in class effective-virtual-slot-definition
is not consistent in the following 2 methods in gffi/virtual-slots.lisp.

(defmethod compute-slot-reader-function :around ((slotd effective-virtual-slot-definition) &optional (signal-unbound-p t))
  ...
       ;; An explicit boundp function has been supplied
       ((slot-boundp slotd 'boundp) 
	(let ((unbound-value (slot-value slotd 'boundp)))
	  #'(lambda (object)
	      (let ((value (funcall reader-function object)))
		(if (eq value unbound-value)
		    (slot-unbound (class-of object) object (slot-definition-name slotd))
		  value)))))
  ...)

(defmethod compute-slot-boundp-function ((slotd effective-virtual-slot-definition))
  ...
   ;; An explicit boundp function has been supplied
   ((slot-boundp slotd 'boundp)
    (let ((boundp (slot-value slotd 'boundp)))
      #-sbcl boundp
      #+sbcl
      (etypecase boundp
	(symbol #'(lambda (object) (funcall boundp object)))
	(function boundp))))

   ;; An unbound value has been supplied
   ((slot-boundp slotd 'unbound)
    (let ((reader-function (compute-slot-reader-function slotd nil))
	  (unbound-value (slot-value slotd 'unbound)))
      #'(lambda (object)
	  (not (eql (funcall reader-function object) unbound-value)))))
   
  ...)

If COMPUTE-SLOT-BOUNDP-FUNCTION is correct, shouldn't we use UNBOUND, instead
of BOUNDP, in COMPUTE-SLOT-READER-FUNCTION :AROUND?

Best wishes,

-cph

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/