On Tue, Aug 10, 2010 at 1:15 AM, Nicolas Oury <nicolas.o...@gmail.com> wrote:
>  So, in this particular case, Scheme does not warranty no exhaustion
> of resources.

Yes, but your recursion depth is limited to the length of the list you
are processing.  So if you have enough resources to comfortably hold
and manipulate the list in memory, odds are good you have enough
resources to handle the non-tail recursive processing of the list.

Generally speaking, I find I do not have to worry about "blowing the
stack" in Scheme, and as a result, non-tail-call structural recursion
(such as the algorithm that kicked off this thread) is perfectly
idiomatic in the implementations of Scheme I have used (mostly
Racket).  In Clojure, I find stack limitations are a real issue unless
I transform the algorithms into a tail-recursive accumulator style.
For lists, it's usually not hard.  For trees, it can be a bit of a
pain.

Since Clojure has a lot of similarities with Scheme, this is a key
difference that needs to be emphasized to people coming from Scheme or
using a Scheme-based textbook to try to learn Clojure.

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

Reply via email to