[Larceny-users] Infinite Loop bug in list.sch

Ray Racine ray.racine at gmail.com
Sat Jul 19 15:41:38 EDT 2008


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))
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the Larceny-users mailing list