More likely it has to do with simply naming many of the intermediate results in a calculation. That often results in long let bindings with short let bodies. I've written many a function that's basically
(defn foo [x] (let [stuff more stuff yet more stuff res (Thingy. args)] res)) or something close to that, or with a one-liner body of (Thingy. args) or whatever instead of first naming that "res". It's useful to make long and intricate chains of operations more readable than a very long nested sexp (and unlike the threading macros doesn't care where each result feeds into the next operation, and does let each one have its own name that helps document what it is or what it's for) and it's especially useful if a single intermediate result is used in more than one place subsequently. On Thu, Sep 5, 2013 at 2:05 AM, Kuba Roth <kuba.r...@gmail.com> wrote: > I'm currently working with tree-seq function from clojure.core and there > is one thing I'm struggling to understand... Could you please explain why > pretty much all of the body of the function sits within 'let binding' and > not in the 'let body' where only (walk root) is placed? > Has it something to do with tail recursion? > > Thank you, > Kuba > > -- > -- > 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/groups/opt_out. > -- -- 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/groups/opt_out.