- (multiple-value-bind (low high)
- (cond ((csubtypep step-type (specifier-type '(real 0 *)))
- (values (numeric-type-low initial-type)
- (when (and (numeric-type-p set-type)
- (numeric-type-equal set-type initial-type))
- (numeric-type-high set-type))))
- ((csubtypep step-type (specifier-type '(real * 0)))
- (values (when (and (numeric-type-p set-type)
- (numeric-type-equal set-type initial-type))
- (numeric-type-low set-type))
- (numeric-type-high initial-type)))
- (t
- (values nil nil)))
- (modified-numeric-type initial-type
- :low low
- :high high
- :enumerable nil)))))
+ (labels ((leftmost (x y cmp cmp=)
+ (cond ((eq x nil) nil)
+ ((eq y nil) nil)
+ ((listp x)
+ (let ((x1 (first x)))
+ (cond ((listp y)
+ (let ((y1 (first y)))
+ (if (funcall cmp x1 y1) x y)))
+ (t
+ (if (funcall cmp x1 y) x y)))))
+ ((listp y)
+ (let ((y1 (first y)))
+ (if (funcall cmp= x y1) x y)))
+ (t (if (funcall cmp x y) x y))))
+ (max* (x y) (leftmost x y #'> #'>=))
+ (min* (x y) (leftmost x y #'< #'<=)))
+ (declare (inline compare))
+ (multiple-value-bind (low high)
+ (cond ((csubtypep step-type (specifier-type '(real 0 *)))
+ (values (numeric-type-low initial-type)
+ (when (and (numeric-type-p set-type)
+ (numeric-type-equal set-type initial-type))
+ (max* (numeric-type-high initial-type)
+ (numeric-type-high set-type)))))
+ ((csubtypep step-type (specifier-type '(real * 0)))
+ (values (when (and (numeric-type-p set-type)
+ (numeric-type-equal set-type initial-type))
+ (min* (numeric-type-low initial-type)
+ (numeric-type-low set-type)))
+ (numeric-type-high initial-type)))
+ (t
+ (values nil nil)))
+ (modified-numeric-type initial-type
+ :low low
+ :high high
+ :enumerable nil))))))