Hi,
I am doing my first steps in Clojure and I have a problem with "recur".
Here's an example of the HTTP Kit's handler I just wrote to test drive the
first Clojure piece of code of mine:

(defn ws [req]
  (with-channel req channel
    (loop [x 1]
      (timer/schedule-task
        3000
        (println x)
        (recur (+ x 1))))))

Trouble is, the org.httpkit.timer/schedule-task macro wraps my form with
"recur" inside a function, so recur does not schedule a new timer, it just
loops over (println x) form:

https://github.com/http-kit/http-kit/blob/2.1.19/src/org/httpkit/timer.clj#L27

As far as I can see, there are no named recursion targets, so how can I
loop the schedule?

Regards,
Witold Szczerba

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to