On Mon, Sep 8, 2008 at 9:04 AM, noahr <[EMAIL PROTECTED]> wrote:

>
> I'm a bit confused about the nature of recur.  Is there a guideline
> for understanding what part of the code recur will 'go to'. Obviously
> you can have a LOOP expression, but apparently you can also recur to
> other functions. So I'm wondering WHICH functions can you recur to,
> all? some? What if you have a loop and one of these recursion-point-
> setting functions in between the loop and the RECUR. Will recur jump
> 'past it'  to get to the loop? etc etc
>
> --n
>

http://clojure.org/functional_programming answers your question more
explicitly than the API docs: "... the recur special
operator<http://clojure.org/special_forms>,
which does constant-space recursive looping by rebinding and jumping to the
nearest enclosing loop or function frame."

In other words, you can recur to any function, and recur won't jump out of a
function to a higher level loop.

--Shawn

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

Reply via email to