Skip to content

Commit

Permalink
changed goldfish/liii/list.scm
Browse files Browse the repository at this point in the history
  • Loading branch information
StarSugar committed Sep 3, 2024
1 parent 7389c47 commit d66a9ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions goldfish/liii/list.scm
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
; Liii List extensions
list-view flatmap
list-null? list-not-null? not-null-list?
length=
length=?
)
(import (srfi srfi-1))
(begin

(define (length=? x scheme-list)
(cond ((and (= x 0) (null? scheme-list)) #t)
((or (= x 0) (null? scheme-list)) #f)
(else (length= (- x 1) (cdr scheme-list)))))
(else (length=? (- x 1) (cdr scheme-list)))))

(define (list-view scheme-list)
(define (f-inner-reducer scheme-list filter filter-func rest-funcs)
Expand All @@ -55,7 +55,7 @@
(cddr rest-funcs)))))
(define (f-inner . funcs)
(cond ((null? funcs) scheme-list)
((length= 2 scheme-list)
((length=? 2 scheme-list)
(list-view ((car funcs) (cadr funcs) scheme-list)))
((even? (length funcs))
(f-inner-reducer scheme-list
Expand Down

0 comments on commit d66a9ee

Please sign in to comment.