(define (version-comparator < >)
(named-lambda (version-compare v1 v2)
- (cond ((eq? #f v1)
- #t)
- ((eq? #f v2)
- #f)
- ((null? v2)
- #f)
- ((null? v1) ;; and (pair? v2)
- #t)
- ((< (car v1) (car v2))
- #t)
- ((> (car v1) (car v2))
- #f)
- (else
- (version<? (cdr v1) (cdr v2))))))
+ (let loop ((v1 v1) (v2 v2))
+ (cond ((eq? #f v1)
+ #t)
+ ((eq? #f v2)
+ #f)
+ ((null? v2)
+ #f)
+ ((null? v1) ;; and (pair? v2)
+ #t)
+ ((< (car v1) (car v2))
+ #t)
+ ((> (car v1) (car v2))
+ #f)
+ (else
+ (loop (cdr v1) (cdr v2)))))))
(define (->version string)
(and string