Odp: Re: Cron algorithm challenge

2011-08-23 Thread Michael Jaaka
Wow nice! :-) Of course wait-till can be done with Timers build-in JDK. And here is a proposition for cron parsing function: (defn parse-cron-expr[ pattern ] (let[ cal (Calendar/getInstance) ] (let [[min-pat hour-pat day-pat month-pat week-pat] (letfn[ (parse-cron[ val pos cal ] (letfn[ (range-

Re: Cron algorithm challenge

2011-08-23 Thread Meikel Brandmeyer
Hi, Am 23.08.2011 um 18:01 schrieb Michael Jaaka: > I have some challenge for you, sine it is easy express it in > imperative language I would like to ask you if is it possible to > create DSL to express such algorithm in clojure or if is it too > complicated just write it in functional manner. T

Re: Cron algorithm challenge

2011-08-23 Thread Michael Jaaka
After the post I suddenly saw the code in my mind: http://pastebin.com/kYYYirdb The expression abilities are truly near the mind. Clojure rox :-) On Aug 23, 6:01 pm, Michael Jaaka wrote: > Hi! > > I have some challenge for you, sine it is easy express it in > imperative language I would like to a

Cron algorithm challenge

2011-08-23 Thread Michael Jaaka
Hi! I have some challenge for you, sine it is easy express it in imperative language I would like to ask you if is it possible to create DSL to express such algorithm in clojure or if is it too complicated just write it in functional manner. The challenge is to write cron algorithm. I can express