I've run into several situations where I want to query for objects that
match values two or more slots.  I currently do something like this:

(defclass my-class ()
  ((a :accessor slot-a)
   (b :accessor slot-b
      :index b))
  (:documentation "my test class"))

(find-if (lambda (obj)
           (equal (slot-a obj) val-a))
         (elephant:get-instances-by-value 'my-class 'slot-b val-b))


Is this a reasonable way of finding an object of type 'my-class that matches
on values val-a and val-b for slots a and b?

Yarek
_______________________________________________
elephant-devel site list
elephant-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/elephant-devel

Reply via email to