Changeset 11852


Ignore:
Timestamp:
05/10/09 11:47:29 (13 years ago)
Author:
vvoutilainen
Message:

Combine derive-type flets into a helper function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r11851 r11852  
    61666166            (and high1 high2 (- high1 high2))))
    61676167
     6168(defun derive-compiler-types (args op)
     6169  (flet ((combine (x y)
     6170      (derive-type-numeric-op op x y)))
     6171    (reduce #'combine (cdr args) :key #'derive-compiler-type
     6172      :initial-value (derive-compiler-type (car args)))))
     6173
    61686174(defknown derive-type-minus (t) t)
    61696175(defun derive-type-minus (form)
     
    61746180                                 zero-integer-type
    61756181                                 (derive-compiler-type (%car args))))
    6176       (2 (flet ((combine (x y)
    6177                   (derive-type-numeric-op op x y)))
    6178            (reduce #'combine (cdr args) :key #'derive-compiler-type
    6179                    :initial-value (derive-compiler-type (car args))))))))
    6180 
     6182      (2 (derive-compiler-types args op)))))
    61816183
    61826184(define-int-bounds-derivation + (low1 high1 low2 high2)
     
    61906192    (if (null args)
    61916193        zero-integer-type
    6192         (flet ((combine (x y)
    6193                  (derive-type-numeric-op op x y)))
    6194           (reduce #'combine (cdr args) :key #'derive-compiler-type
    6195                   :initial-value (derive-compiler-type (car args)))))))
     6194      (derive-compiler-types args op))))
    61966195
    61976196(define-int-bounds-derivation * (low1 high1 low2 high2)
     
    62196218    (if (null args)
    62206219        one-integer-type
    6221         (flet ((combine (x y)
    6222                  (derive-type-numeric-op op x y)))
    6223           (reduce #'combine (cdr args) :key #'derive-compiler-type
    6224                   :initial-value (derive-compiler-type (car args)))))))
     6220      (derive-compiler-types args op))))
    62256221
    62266222(define-int-bounds-derivation max (low1 low2 high1 high2)
     
    62326228  (let ((op (car form))
    62336229        (args (cdr form)))
    6234     (flet ((combine (x y)
    6235              (derive-type-numeric-op op x y)))
    6236       (reduce #'combine (cdr args) :key #'derive-compiler-type
    6237               :initial-value (derive-compiler-type (car args))))))
     6230    (derive-compiler-types args op)))
    62386231
    62396232(define-int-bounds-derivation min (low1 high1 low2 high2)
     
    62456238  (let ((op (car form))
    62466239        (args (cdr form)))
    6247     (flet ((combine (x y)
    6248              (derive-type-numeric-op op x y)))
    6249       (reduce #'combine (cdr args) :key #'derive-compiler-type
    6250               :initial-value (derive-compiler-type (car args))))))
     6240    (derive-compiler-types args op)))
    62516241
    62526242;; read-char &optional input-stream eof-error-p eof-value recursive-p => char
Note: See TracChangeset for help on using the changeset viewer.