[elephant-devel] Backend and data retrieval questions

Leslie P. Polzer sky at viridian-project.de
Wed Oct 22 07:46:15 UTC 2008


> using cursor API. to get first ten items, first do cursor-pset, then
> cursor-pnext
> 9 times.

I'd use the higher-level MAP-CLASS instead:

(defun first-ten (classname) ; untested
  (let ((i 1) result)
    (map-class
      (lambda (o)
        (when (> i 10)
          (return-from first-ten result))
        (push o result))
      classname)
    result))

That doesn't work if you want to start somewhere in the middle,
though.

-- 
LinkedIn Profile: http://www.linkedin.com/in/polzer
Xing Profile: https://www.xing.com/profile/LeslieP_Polzer
Blog: http://blog.viridian-project.de/





More information about the elephant-devel mailing list