On May 15, 4:41 pm, "Stephen C. Gilardi" <squee...@mac.com> wrote:
>
> Another nice benefit of Clojure's efficient vectors over lists is that  
> functions that produce a collection of results can produce and store  
> them in order without needing to "reverse" the result just before  
> returning. Reversing is a common operation in some other Lisps and a  
> rare one in Clojure.
>
That's a bit of a red herring, though? You can always rewrite the code
to use normal (as opposed to tail) recursion, if you don't want to use
reverse. Depending on how large the resulting list is, it's a space-vs-
time tradeoff: the normal recursive version is probably faster but
uses (a constant factor of) more memory.

Granted, if the cost of function calls is high, then having efficient
vectors in conjunction with a looping construct (e.g. recur) would
actually be faster.

--
Michel
--~--~---------~--~----~------------~-------~--~----~
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 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to