From e69a69c2b2159726f1bd4b092a5a85c29421e35b Mon Sep 17 00:00:00 2001 From: mainzelm Date: Fri, 7 Apr 2006 09:43:29 +0000 Subject: [PATCH] Remove refresh-all from care-for-return reimplement fill-up and cat --- scheme/input-fields.scm | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/scheme/input-fields.scm b/scheme/input-fields.scm index 1a317ae..69fea07 100644 --- a/scheme/input-fields.scm +++ b/scheme/input-fields.scm @@ -403,7 +403,6 @@ ((#f) ;; konnte nichts machen (values #t #f)) ((#t) ;; etwas zugefĆ¼gt oder entfernt - (refresh-all input-field) (values #t #t)) (else (values #t #f))))) @@ -819,7 +818,7 @@ y-edit-pos) (list (append - (reverse (cdr (reverse current-line))) + (drop-right current-line 1) (list-ref edit-lines (+ y-edit-pos 1)))) (drop edit-lines @@ -1542,35 +1541,15 @@ (define fill-up (lambda (lst len elem) - (append lst - (let loop ((n (- len - (length lst)))) - (if (< n 0) - '() ;'error--fill-up - (if (zero? n) - '() - (cons elem - (loop (- n 1))))))))) + (let* ((lst-len (length lst)) + (needed (- len lst-len))) + (if (= needed 0) + lst + (append lst (make-list needed elem)))))) (define cat (lambda (lst-lst) - (if (null? lst-lst) - '() - (append (car lst-lst) - (cat (cdr lst-lst)))))) - -(define split - (lambda (lst n) - (let loop ((fst '()) - (scnd lst) - (n n)) - (if (or (null? scnd) - (zero? n)) - (values (reverse fst) scnd) - (loop (cons (car scnd) - fst) - (cdr scnd) - (- n 1)))))) + (apply append lst-lst))) (define remove (lambda (lst pos)