projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f12c57
)
Generalize boolean=? to support multiple arguments.
author
Chris Hanson
<org/chris-hanson/cph>
Tue, 1 May 2018 06:48:06 +0000
(23:48 -0700)
committer
Chris Hanson
<org/chris-hanson/cph>
Tue, 1 May 2018 06:48:06 +0000
(23:48 -0700)
src/runtime/boole.scm
patch
|
blob
|
history
diff --git
a/src/runtime/boole.scm
b/src/runtime/boole.scm
index 66225992828987ee5b80cd30828412f39a0e6e2a..688b872fb2c5c7f2cb62e3faf4a0a7d3925e40d2 100644
(file)
--- a/
src/runtime/boole.scm
+++ b/
src/runtime/boole.scm
@@
-39,8
+39,12
@@
USA.
(or (eq? object #f)
(eq? object #t)))
-(define (boolean=? x y)
- (if x y (not y)))
+;; R7RS says that the args to this procedure must satisfy boolean?.
+;; We relax that to allow any object.
+(define (boolean=? b1 b2 . bs)
+ (and (if b1 b2 (not b2))
+ (every (if b1 (lambda (b) b) not)
+ bs)))
(define (boolean/or . arguments)
(let loop ((arguments arguments))