feat: add xlen for gen-update-list

This commit is contained in:
SouthFox 2024-11-02 23:38:24 +08:00
parent 96af464e22
commit 51dbcad844

View file

@ -198,20 +198,21 @@
(find-string-list-len-iter (cdr string-list) (+ (string-length (car (last-pair (car string-list)))) offset) ))) (find-string-list-len-iter (cdr string-list) (+ (string-length (car (last-pair (car string-list)))) offset) )))
(find-string-list-len-iter string-list 0)) (find-string-list-len-iter string-list 0))
(define (gen-update-list string-length x y len) (define (gen-update-list string-length x y xlen ylen)
(define (up-iter string-length x y llen part) (define (up-iter string-length x y xlen llen part)
(if (= 0 llen) (if (= 0 llen)
part part
(up-iter string-length (up-iter string-length
x x
(+ 1 y) (+ 1 y)
xlen
(- llen 1) (- llen 1)
(append part (append part
(list (list (list (list
(+ (* y string-length) x ) (+ (* y string-length) x )
(+ len (+ (* y string-length) x)) (+ xlen (+ (* y string-length) x))
)))))) ))))))
(up-iter (+ 1 string-length) x y len '())) (up-iter (+ 1 string-length) x y xlen ylen '()))
;; Main ;; Main
(set! *template* template-task) (set! *template* template-task)