On Sun, Nov 7, 2010 at 3:28 PM, iko...@gmail.com <iko...@gmail.com> wrote: > 2010/11/7 David Sletten <da...@bosatsu.net> >> >> Or for those of you who prefer that other people won't be able to read >> your code: >> (defn foldr [f coll] >> (reduce #(f %2 %1) (reverse coll))) >> >
fold-right can not be made tail-recursive and in one-pass at the same time. reverse and reduce is a good way to do it. -- 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