From: Taylor R Campbell Date: Sun, 10 Feb 2019 22:39:07 +0000 (+0000) Subject: Convert multi-LETREC to internal definitions in sos/class.scm. X-Git-Tag: mit-scheme-pucked-10.1.10~6^2~7^2~6 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=10f62e3e7cbab2d3d0eb47380adeed8243e4ab0f;p=mit-scheme.git Convert multi-LETREC to internal definitions in sos/class.scm. --- diff --git a/src/sos/class.scm b/src/sos/class.scm index 101003095..409585bd7 100644 --- a/src/sos/class.scm +++ b/src/sos/class.scm @@ -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)