[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: proper tail recusion for `or'
DrScheme is tail-recursive. The Stepper reconstructs intermediate terms
from the actual execution state. It is the reconstruction that places
or into the program text. Why? I forgot but I am sure that John Clements
has a lengthy explanation for it :-)
-- Matthias
X-Authentication-Warning: fast.cs.utah.edu: majordom set sender to owner-plt-scheme@flux.cs.utah.edu using -f
From: Marco Maggesi <maggesi@math.unifi.it>
Date: 15 Mar 2001 13:15:40 +0100
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
Content-Type: text/plain; charset=us-ascii
Sender: owner-plt-scheme@fast.cs.utah.edu
Precedence: bulk
Please, correct me if I am wrong. By using the stepper, it seems that
DrScheme do not handle tail recursion properly for `or'. Is this a bug?
Here is an example:
(define (list-or l)
(if (null? l)
#t
(or (car l) (list-or (cdr l)))))
(list-or (list #f #f #f #f #f #f #t))
Thank you.
MM