I've been looking into Clojure and now Scheme for a while. Currently
it's been SICP.
I notice that SICP has examples of recursion such as a binary tree
builder that is something like the following:
(define (tree top elements split-value)
(cons (tree (filter ( split-value) elements) )
On Thu, Dec 1, 2011 at 7:03 AM, John Holland jbholl...@gmail.com wrote:
I've been looking into Clojure and now Scheme for a while. Currently
it's been SICP.
I notice that SICP has examples of recursion such as a binary tree
builder that is something like the following:
(define (tree top
Tree-building functions are not usually tail-recursive. I'm not even sure
that Scheme will do tail-call elimination in that case. The Java stack can
hold 8000 frames or so, so log base 2 is probably small enough to avoid a
stack overflow when building a tree.
You could probably rewrite this
On Dec 1, 2:14 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote:
Tree-building functions are not usually tail-recursive. I'm not even sure
that Scheme will do tail-call elimination in that case. The Java stack can
hold 8000 frames or so, so log base 2 is probably small enough to avoid a