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

Re: xlib:<mumble>-equal

Your message:

    The specification for these predicates is not clear. Should they return
    true iff the two drawable/font/gcontext/etc. objects are EQ (the current
    Or should they return true iff the two objects name the same server

    The mere existence of these functions implies that the latter definition
    was intended...


Here's the current implementation:

(defmacro make-mumble-equal (type)
  ;; When cached, EQ works fine, otherwise test resource id's and displays
  (let ((predicate (xintern type '-equal))
	(id (xintern type '-id))
	(dpy (xintern type '-display)))
    (if (member type *clx-cached-types*)
	`(within-definition (,type make-mumble-equal)
	   (proclaim '(inline ,predicate))
	   (defun ,predicate (a b) (eq a b)))
      `(within-definition (,type make-mumble-equal)
	 (defun ,predicate (a b)
	   (declare (type ,type a b))
	   (and (= (,id a) (,id b))
		(eq (,dpy a) (,dpy b))))))))

Are you arguing that the final "eq" (for non cached objects) should be a
different test?  Seems like two different (non-eq) displays couldn't have
equal objects, since they will have a different range of resource id's.
Or are you thinking that someone could copy a display object, and thus have
two display objects that reference the same socket?

Doesn't the current cacheing system guarantee that you will have only one
client object for each server object for objects that are cached?

	-- John