Making boolean=? and symbol=? n-ary.

Fixes issue #204.
This commit is contained in:
Alex Shinn 2013-11-02 22:30:40 +09:00
parent 906d071756
commit cefec12756
2 changed files with 8 additions and 2 deletions

View file

@ -34,8 +34,10 @@
(define exact inexact->exact) (define exact inexact->exact)
(define inexact exact->inexact) (define inexact exact->inexact)
(define (boolean=? x y) (eq? x y)) (define (boolean=? x y . o)
(define (symbol=? x y) (eq? x y)) (and (eq? x y) (if (pair? o) (apply boolean=? y o) #t)))
(define (symbol=? x y . o)
(and (eq? x y) (if (pair? o) (apply symbol=? y o) #t)))
(define call/cc call-with-current-continuation) (define call/cc call-with-current-continuation)

View file

@ -801,6 +801,8 @@
(test #t (boolean=? #t #t)) (test #t (boolean=? #t #t))
(test #t (boolean=? #f #f)) (test #t (boolean=? #f #f))
(test #f (boolean=? #t #f)) (test #f (boolean=? #t #f))
(test #t (boolean=? #f #f #f))
(test #f (boolean=? #t #t #f))
(test-end) (test-end)
@ -916,6 +918,8 @@
(test #t (symbol=? 'a 'a)) (test #t (symbol=? 'a 'a))
(test #f (symbol=? 'a 'A)) (test #f (symbol=? 'a 'A))
(test #t (symbol=? 'a 'a 'a))
(test #f (symbol=? 'a 'a 'A))
(test "flying-fish" (test "flying-fish"
(symbol->string 'flying-fish)) (symbol->string 'flying-fish))