Quite right. Thank you for the reminder. On Wednesday, November 2, 2011 2:51:06 AM UTC-6, Alan Malloy wrote: > > The call to (set day-nums) should really be pulled out of the inner > function to avoid rebuilding the set over and over: > > (defn day-of-week-stream [& day-nums] > (let [day-set (set day-nums)] > (filter #(day-set (.. % dayOfWeek get)) (today+all-future- > dates)))) > > On Nov 1, 10:57 pm, Baishampayan Ghose <b.g...@gmail.com> wrote: > > On Wed, Nov 2, 2011 at 11:01 AM, Benny Tsai <benny...@gmail.com> wrote: > > > Untested, since I don't have JodaTime installed, but something like > this > > > maybe? > > > > > (defn day-of-week-stream [& day-nums] > > > (filter #((set day-nums) (.. % dayOfWeek get)) > (today+all-future-dates))) > > > > This one is a good solution. No need to interleave two streams when > > you can generate one directly. > > > > Regards, > > BG > > > > -- > > Baishampayan Ghose > > b.ghose at gmail.com
-- 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