* Disable type-checks in full calls to LIST*, because we know the &REST
list is a proper list.
* Handle 1 argument case in the source-transform.
* Add a derive-type optimizer, so we can figure out the common case
when the return value is know to be a CONS.
(defun list* (arg &rest others)
#!+sb-doc
- "Return a list of the arguments with last cons a dotted pair"
+ "Return a list of the arguments with last cons a dotted pair."
+ ;; We know the &REST is a proper list.
+ (declare (optimize (sb!c::type-check 0)))
(cond ((atom others) arg)
((atom (cdr others)) (cons arg (car others)))
(t (do ((x others (cdr x)))
(t (values nil t))))
;;; And similarly for LIST*.
-(define-source-transform list* (&rest args)
- (case (length args)
- (2 `(cons ,(first args) ,(second args)))
- (t (values nil t))))
+(define-source-transform list* (arg &rest others)
+ (cond ((not others) arg)
+ ((not (cdr others)) `(cons ,arg ,(car others)))
+ (t (values nil t))))
+
+(defoptimizer (list* derive-type) ((arg &rest args))
+ (if args
+ (specifier-type 'cons)
+ (lvar-type arg)))
;;; Translate RPLACx to LET and SETF.
(define-source-transform rplaca (x y)
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.17.13"
+"1.0.17.14"