[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
second arg of call-with-values not in tail context
From: |
Matthias Koeppe |
Subject: |
second arg of call-with-values not in tail context |
Date: |
26 Mar 2001 12:16:38 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.6 |
R5RS requires that the second argument passed to `call-with-values',
must be called via a tail call; see (r5rs)Proper tail recursion.
Guile calls the second argument via an ordinary call; this causes
stack overflows in many situations. Here is an example; this
construction frequently occurs when one uses the `receive' special
form.
(let loop ((i 1000))
(if (> i 0)
(call-with-values
(lambda () (values 1))
(lambda (x) (loop (- i 1))))))
Can we get this fixed?
--
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe
- second arg of call-with-values not in tail context,
Matthias Koeppe <=