Added boolean=? and symbol=?

This commit is contained in:
Abdulaziz Ghuloum 2007-08-28 15:03:21 -04:00
parent 2b6a3ef715
commit e2ca2dffb2
4 changed files with 26 additions and 5 deletions

Binary file not shown.

View File

@ -4,15 +4,15 @@
(export fixnum? flonum? bignum? ratnum? number? complex? real? rational?
integer? exact? eof-object? bwp-object? immediate?
boolean? char? vector? bytevector? string? procedure? null? pair?
symbol? code? not weak-pair? eq? eqv? equal?)
symbol? code? not weak-pair? eq? eqv? equal? boolean=?
symbol=?)
(import
(except (ikarus) fixnum? flonum? bignum? ratnum? number? complex? real?
rational? integer? exact? eof-object? bwp-object?
immediate? boolean? char? vector? bytevector? string? procedure?
null? pair? weak-pair? symbol? code? not eq? eqv? equal?
port? input-port? output-port?)
port? input-port? output-port? boolean=? symbol=?)
(ikarus system $fx)
(ikarus system $flonums)
(ikarus system $pairs)
@ -128,8 +128,27 @@
(or (sys:eq? x y)
(and (number? x) (number? y) (= x y)))))
(define boolean=?
(lambda (x y)
(if (sys:boolean? x)
(if (sys:eq? x y)
#t
(if (sys:boolean? y)
#f
(error 'boolean=? "~s is not a boolean" y)))
(error 'boolean=? "~s is not a boolean" x))))
(define symbol=?
(lambda (x y)
(if (sys:symbol? x)
(if (sys:eq? x y)
#t
(if (sys:symbol? y)
#f
(error 'symbol=? "~s is not a symbol" y)))
(error 'symbol=? "~s is not a symbol" x))))
(module (equal?)
(define vector-loop
(lambda (x y i n)

View File

@ -244,6 +244,7 @@
'([void i]
[not i r]
[boolean? i r]
[boolean=? i r]
[null? i r]
[procedure? i r]
[eof-object? i r]
@ -462,6 +463,7 @@
[exact->inexact i r]
[inexact->exact i r]
[symbol? i r symbols]
[symbol=? i r symbols]
[gensym? i symbols]
[gensym i symbols]
[getprop i symbols]

View File

@ -85,7 +85,7 @@
[assert S ba]
[assertion-violation S ba]
[atan S ba]
[boolean=? S ba]
[boolean=? C ba]
[boolean? C ba]
[car C ba]
[cdr C ba]
@ -215,7 +215,7 @@
[string? C ba]
[substring C ba]
[symbol->string C ba]
[symbol=? S ba]
[symbol=? C ba]
[symbol? C ba]
[tan S ba]
[truncate S ba]