[elephant-devel] Querying for objects on two slots

Yarek Kowalik yarek.kowalik at gmail.com
Tue Jan 6 06:36:29 UTC 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20090105/48bb352b/attachment.html>


More information about the elephant-devel mailing list