Issue #369 - Switch over to multi-arg string cmp

This commit is contained in:
Justin Ethier 2020-06-04 22:48:17 -04:00
parent 5bb83cbfc6
commit 346a6e4bd5

View file

@ -605,14 +605,12 @@
(define (char>=? c1 c2 . cs) (Cyc-bin-op-char >= c1 (cons c2 cs)))
; TODO: char-ci predicates (in scheme/char library)
(define (string=? str1 str2 . strs) (Cyc-bin-op fast-string=? str1 (cons str2 strs)))
(define (string<? str1 str2 . strs) (Cyc-bin-op fast-string<? str1 (cons str2 strs)))
(define (string<=? str1 str2 . strs) (Cyc-bin-op fast-string<=? str1 (cons str2 strs)))
(define (string>? str1 str2 . strs) (Cyc-bin-op fast-string>? str1 (cons str2 strs)))
(define (string>=? str1 str2 . strs) (Cyc-bin-op fast-string>=? str1 (cons str2 strs)))
; ; TODO: generalize to multiple arguments: (define (string<? str1 str2 . strs)
;(define (string=? str1 str2 . strs) (Cyc-bin-op fast-string=? str1 (cons str2 strs)))
(define (string=? str1 str2) (equal? (string-cmp str1 str2) 0))
(define (string<? str1 str2) (< (string-cmp str1 str2) 0))
(define (string<=? str1 str2) (<= (string-cmp str1 str2) 0))
(define (string>? str1 str2) (> (string-cmp str1 str2) 0))
(define (string>=? str1 str2) (>= (string-cmp str1 str2) 0))
(define (fast-string=? str1 str2) (equal? (string-cmp str1 str2) 0))
(define (fast-string<? str1 str2) (< (string-cmp str1 str2) 0))
(define (fast-string<=? str1 str2) (<= (string-cmp str1 str2) 0))