(let ((var (first vars))
(cases (sort cases #'type-test-order :key #'car)))
`((typecase ,var
- ,@(mapcar #'(lambda (case)
- `(,(first case)
- ,@(generate-number-dispatch (rest vars)
- (rest error-tags)
- (cdr case))))
+ ,@(mapcar (lambda (case)
+ `(,(first case)
+ ,@(generate-number-dispatch (rest vars)
+ (rest error-tags)
+ (cdr case))))
cases)
(t (go ,(first error-tags))))))
cases))
(defun complex (realpart &optional (imagpart 0))
#!+sb-doc
- "Builds a complex number from the specified components."
+ "Return a complex number with the specified real and imaginary components."
(flet ((%%make-complex (realpart imagpart)
(cond #!+long-float
((and (typep realpart 'long-float)
(defun realpart (number)
#!+sb-doc
- "Extracts the real part of a number."
+ "Extract the real part of a number."
(typecase number
#!+long-float
((complex long-float)
(defun imagpart (number)
#!+sb-doc
- "Extracts the imaginary part of a number."
+ "Extract the imaginary part of a number."
(typecase number
#!+long-float
((complex long-float)
(defun - (number &rest more-numbers)
#!+sb-doc
- "Subtracts the second and all subsequent arguments from the first.
- With one arg, negates it."
+ "Subtract the second and all subsequent arguments from the first;
+ or with one argument, negate the first argument."
(if more-numbers
(do ((nlist more-numbers (cdr nlist))
(result number))
nil
(macrolet ((foo (&rest stuff)
`(typecase obj2
- ,@(mapcar #'(lambda (foo)
- (let ((type (car foo))
- (fn (cadr foo)))
- `(,type
- (and (typep obj1 ',type)
- (,fn obj1 obj2)))))
+ ,@(mapcar (lambda (foo)
+ (let ((type (car foo))
+ (fn (cadr foo)))
+ `(,type
+ (and (typep obj1 ',type)
+ (,fn obj1 obj2)))))
stuff))))
(foo
(single-float eql)