Convert `or' to `if' where the value is a boolean.
authorChris Hanson <org/chris-hanson/cph>
Tue, 16 Dec 1986 19:36:45 +0000 (19:36 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 16 Dec 1986 19:36:45 +0000 (19:36 +0000)
v7/src/runtime/equals.scm
v7/src/runtime/list.scm

index d0fe714680cd8861e1d48283bcac50242e3dab03..79029e8ff13d0a36860771286864138a30576338 100644 (file)
@@ -37,6 +37,8 @@
 
 ;;;; Equality
 
+;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/equals.scm,v 1.10 1986/12/16 19:36:12 cph Exp $
+
 (declare (usual-integrations))
 \f
 (let-syntax ((type?
@@ -50,7 +52,7 @@
   ;; numbers specially, but it turns out that EQ? does the right thing
   ;; for everything but numbers, so we take advantage of that.
   (if (eq? x y)
-      #T
+      true
       (and (primitive-type? (primitive-type x) y)
           (or (type? big-fixnum y)
               (type? big-flonum y))
@@ -58,7 +60,7 @@
 
 (define (equal? x y)
   (if (eq? x y)
-      #T
+      true
       (and (primitive-type? (primitive-type x) y)
           (cond ((or (type? big-fixnum y)
                      (type? big-flonum y))
@@ -69,7 +71,8 @@
                 ((type? vector y)
                  (let ((size (vector-length x)))
                    (define (loop index)
-                     (or (= index size)
+                     (if (= index size)
+                         true
                          (and (equal? (vector-ref x index)
                                       (vector-ref y index))
                               (loop (1+ index)))))
index 4941e9cd8d8f6076697bf356614621ac61ddd83f..23475858cb9e436ba4a0a3dec687a1ee4fc650c0 100644 (file)
@@ -18,9 +18,9 @@
 ;;;    future releases; and (b) to inform MIT of noteworthy uses of
 ;;;    this software.
 ;;;
-;;;    3.  All materials developed as a consequence of the use of
-;;;    this software shall duly acknowledge such use, in accordance
-;;;    with the usual standards of acknowledging credit in academic
+;;;    3. All materials developed as a consequence of the use of this
+;;;    software shall duly acknowledge such use, in accordance with
+;;;    the usual standards of acknowledging credit in academic
 ;;;    research.
 ;;;
 ;;;    4. MIT has made no warrantee or representation that the
@@ -28,7 +28,7 @@
 ;;;    under no obligation to provide any services, by way of
 ;;;    maintenance, update, or otherwise.
 ;;;
-;;;    5.  In conjunction with products arising from the use of this
+;;;    5. In conjunction with products arising from the use of this
 ;;;    material, there shall be no use of the name of the
 ;;;    Massachusetts Institute of Technology nor of any adaptation
 ;;;    thereof in any advertising, promotional, or sales literature
@@ -37,6 +37,8 @@
 
 ;;;; List Operations
 
+;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/list.scm,v 1.64 1986/12/16 19:36:45 cph Exp $
+
 (declare (usual-integrations))
 \f
 ;;; This IN-PACKAGE is just a kludge to prevent the definitions of the
@@ -55,9 +57,9 @@
   elements)
 
 (define (list? frob)
-  (or (null? frob)
-      (and (pair? frob)
-          (list? (cdr frob)))))
+  (cond ((null? frob) true)
+       ((pair? frob) (list? (cdr frob)))
+       (else false)))
 
 (define (cons* first-element . rest-elements)
   (define (loop this-element rest-elements)
 
 (define (for-all? predicate)
   (define (loop objects)
-    (or (not (pair? objects))
+    (if (pair? objects)
        (and (predicate (car objects))
-            (loop (cdr objects)))))
+            (loop (cdr objects)))
+       true))
   loop)
 \f
 ;;;; Generalized List Operations
   ((positive-list-searcher (lambda (items)
                             (predicate (car items)))
                           car
-                          #!FALSE)
+                          false)
    list))
 
 (define (list-search-negative list predicate)
   ((negative-list-searcher (lambda (items)
                             (predicate (car items)))
                           car
-                          #!FALSE)
+                          false)
    list))
 \f
 ;;;; Membership Lists
   ((positive-list-searcher (lambda (sub-list)
                             (pred (car sub-list) element))
                           identity-procedure
-                          #!FALSE)
+                          false)
    list))
 
 ;(define memq (member-procedure eq?))
 (define delq! (delete-member-procedure list-deletor! eq?))
 (define delv! (delete-member-procedure list-deletor! eqv?))
 (define delete! (delete-member-procedure list-deletor! equal?))
-\f
+
 ;;;; Association Lists
 
 (define ((association-procedure pred selector) key alist)
   ((positive-list-searcher (lambda (sub-alist)
                             (pred (selector (car sub-alist)) key))
                           car
-                          #!FALSE)
+                          false)
    alist))
 
 ;(define assq (association-procedure eq? car))