Discussion:
[Larceny-users] Infinite Loop bug in list.sch
Ray Racine
17 years ago
Permalink
procedure assp in list.sch is not taking the cdr of the list when recursing
resulting in an infinite loop.

(assp (lambda (s) (string=? s "a")) '( ("a" . 1))) -> bottom

diff --git a/trunk/larceny_src/src/Lib/Common/list.sch
b/trunk/larceny_src/src/Lib/Common/list.sch
index 95b7487..a4fcda4 100644
--- a/trunk/larceny_src/src/Lib/Common/list.sch
+++ b/trunk/larceny_src/src/Lib/Common/list.sch
@@ -600,7 +600,7 @@
((pred (car x))
x)
(else
- (assp pred list)))))
+ (assp pred (cdr list))))))
(else #f)))
(assp pred list0))

Loading...