(defn pages ([src size] (pages src 0 size)) ([src start size] (lazy-seq (if-let [page (.getPage src start size)] (cons page (pages src (inc start) size))))))
On Apr 28, 2:38 pm, ".Bill Smith" <william.m.sm...@gmail.com> wrote: > I have a Java API that retrieves "pages" of data from a database: you > specify the page number and the page size, it it retrieves row numbers > page-number*page_size through (page-number+1)*page_size - 1. I'd > like to construct a lazy sequence that gets its data using that Java > API. I'm using Clojure 1.1. I would prefer not to use 1.2 until it's > released. I suspect there's a posting or web page somewhere that lays > out the general template for doing this kind of thing. Anyone have > any suggestions? > > Thanks, > Bill Smith > Austin, TX > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en