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 <[email protected]> wrote:
> On Wed, Nov 2, 2011 at 11:01 AM, Benny Tsai <[email protected]> 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 [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en