Hi All -

I am trying convert a  function to use loop/recur and am getting the
dreded

"java.lang.UnsupportedOperationException: Can only recur from tail
position (repl-1:414)" error

(at least dreded for newbies...)

The function takes 2 joda dates and returns a sequence of dates
starting at the first of the month until it is past the second date.
This works using standard recursion but I wanted to use TCO.

Any help is most appreciated (as usual...!)

Thanks

Base


(def date-seq
  (fn [d1 d2]
    (loop [b (-> d1
               (.dayOfMonth)
               (.withMinimumValue))
           e d2]
     (cons b (if (time/before? b e)
               (recur (.plusMonths b 1) e))))))

-- 
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

Reply via email to