help removing some duplication in my Clojure code

2011-06-17 Thread Alex Baranosky
What is the best way to remove the duplication in these two functions?: (defn- next-day-of-week-in-future [day-num] (find-first #(= day-num (.. % dayOfWeek get)) (today+all-future-dates))) (defn- next-day-of-month-in-future [day-of-month] (find-first #(= day-of-month (.. % dayOfMonth get))

Re: help removing some duplication in my Clojure code

2011-06-17 Thread Ken Wesson
On Fri, Jun 17, 2011 at 7:32 PM, Alex Baranosky alexander.barano...@gmail.com wrote: What is the best way to remove the duplication in these two functions?: (defn- next-day-of-week-in-future [day-num]   (find-first #(= day-num (.. % dayOfWeek get)) (today+all-future-dates))) (defn-

Re: help removing some duplication in my Clojure code

2011-06-17 Thread Alex Baranosky
Awesome! I am still really a beginner with macros. I had tried to get one to work, but wasn't sure if it was possible. Thanks! On Fri, Jun 17, 2011 at 8:59 PM, Ken Wesson kwess...@gmail.com wrote: On Fri, Jun 17, 2011 at 7:32 PM, Alex Baranosky alexander.barano...@gmail.com wrote: What is