From 78921fbc27deb754fb92630a88c26846678c37b7 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 30 Apr 2018 23:48:06 -0700 Subject: [PATCH] =?utf8?q?Generalize=20boolean=3D=3F=20to=20support=20mult?= =?utf8?q?iple=20arguments.?= --- src/runtime/boole.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/runtime/boole.scm b/src/runtime/boole.scm index 662259928..688b872fb 100644 --- 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)) -- 2.25.1