From 6daa3501b604091e409ee3536178c117af1fc8c0 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Mon, 10 Sep 2018 20:48:28 -0400 Subject: [PATCH] rebirth: relibprebirth: Fix < and > * build-aux/bootstrap/rebirth/relibprebirth.scm (<, >): Reverse comparisons. This is quite the embarassing mess-up. It appears that it was only used in one place, and so I did not notice the problem until I began writing test cases. --- build-aux/bootstrap/rebirth/relibprebirth.scm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/build-aux/bootstrap/rebirth/relibprebirth.scm b/build-aux/bootstrap/rebirth/relibprebirth.scm index c0f110e..d1fc688 100644 --- a/build-aux/bootstrap/rebirth/relibprebirth.scm +++ b/build-aux/bootstrap/rebirth/relibprebirth.scm @@ -71,9 +71,9 @@ (define (= x y) (string->es "+$$x === +$$y")) (define (> x y) - (string->es "+$$y > +$$x")) + (string->es "+$$x > +$$y")) (define (< x y) - (string->es "+$$y < +$$x")) + (string->es "+$$x < +$$y")) ;; warning: doesn't verify that it's a pair (define (length xs) @@ -120,7 +120,7 @@ (string->es "Array.isArray($$xs)")) (define (pair? xs) (and (list? xs) - (> 0 (length xs)))) + (not (zero? (length xs))))) ;; R7RS string (define (substring s start end) @@ -129,8 +129,6 @@ (string->es "$$s.length")) (define (string=? s1 s2) (string->es "typeof $$s1 === 'string' && $$s1 === $$s2")) - (define (string-ref s i) - (string->es "$$s[$$i] || $$error(`value out of range: ${$$i}`)")) (define (string-append . xs) (string->es "$$xs.join('')"))