diff --git a/scheme/ikarus.lists.ss b/scheme/ikarus.lists.ss index 32445de..9962e36 100644 --- a/scheme/ikarus.lists.ss +++ b/scheme/ikarus.lists.ss @@ -145,18 +145,20 @@ (if (null? h) ac (die 'append "not a proper list" ls))))) - (define revcons + (define rev! (lambda (ls ac) (cond [(null? ls) ac] [else - (revcons ($cdr ls) (cons ($car ls) ac))]))) + (let ([ls^ ($cdr ls)]) + ($set-cdr! ls ac) + (rev! ls^ ls))]))) (define append1 (lambda (ls ls*) (cond [(null? ls*) ls] [else - (revcons (reverse ls ls ls '()) + (rev! (reverse ls ls ls '()) (append1 ($car ls*) ($cdr ls*)))]))) (define append (case-lambda diff --git a/scheme/last-revision b/scheme/last-revision index 4c127d8..600fe59 100644 --- a/scheme/last-revision +++ b/scheme/last-revision @@ -1 +1 @@ -1246 +1248