Convert multi-LETREC to internal definitions in sos/class.scm.
authorTaylor R Campbell <campbell@mumble.net>
Sun, 10 Feb 2019 22:39:07 +0000 (22:39 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sun, 10 Feb 2019 22:39:07 +0000 (22:39 +0000)
src/sos/class.scm

index 101003095e2e3fc45adf4adf2aaf0c66e7900a7d..409585bd75a48b9e0b3ae7ba6a11fc41baa64047 100644 (file)
@@ -259,23 +259,21 @@ USA.
        '())))
 
 (define (remove-if! predicate items)
-  (letrec ((trim-initial-segment
-           (lambda (items)
-             (if (pair? items)
-                 (if (predicate (car items))
-                     (trim-initial-segment (cdr items))
-                     (begin
-                       (locate-initial-segment items (cdr items))
-                       items))
-                 items)))
-          (locate-initial-segment
-           (lambda (last this)
-             (if (pair? this)
-                 (if (predicate (car this))
-                     (set-cdr! last (trim-initial-segment (cdr this)))
-                     (locate-initial-segment this (cdr this)))
-                 this))))
-    (trim-initial-segment items)))
+  (define (trim-initial-segment items)
+    (if (pair? items)
+       (if (predicate (car items))
+           (trim-initial-segment (cdr items))
+           (begin
+             (locate-initial-segment items (cdr items))
+             items))
+       items))
+  (define (locate-initial-segment last this)
+    (if (pair? this)
+       (if (predicate (car this))
+           (set-cdr! last (trim-initial-segment (cdr this)))
+           (locate-initial-segment this (cdr this)))
+       this))
+  (trim-initial-segment items))
 
 (define (remove-item! item items)
   (if (pair? items)