Add source transform for (last x).
Change nconc back to use last (which will be optimized with the
source transform.)
((endp elements))
(let ((ele (car elements)))
(typecase ele
- (cons (rplacd (last1 splice) ele)
+ (cons (rplacd (last splice) ele)
(setf splice ele))
- (null (rplacd (last1 splice) nil))
+ (null (rplacd (last splice) nil))
(atom (if (cdr elements)
(fail ele)
- (rplacd (last1 splice) ele)))
+ (rplacd (last splice) ele)))
(t (fail ele)))))
(return result)))
(null)
(setf (car l) (cdar l)))
(setq res (apply fun (nreverse args)))
(case accumulate
- (:nconc (setq temp (last1 (nconc temp res))))
+ (:nconc (setq temp (last (nconc temp res))))
(:list (rplacd temp (list res))
(setq temp (cdr temp))))))))
(define-source-transform nth (n l) `(car (nthcdr ,n ,l)))
+;; (define-source-transform last (x) `(sb!impl::last1 ,x))
+(define-source-transform last (x)
+ `(let* ((x (the list ,x))
+ (r (cdr x)))
+ (do () ((atom r) x)
+ (shiftf x r (cdr r)))))
+
(defvar *default-nthcdr-open-code-limit* 6)
(defvar *extreme-nthcdr-open-code-limit* 20)
;;; 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".)
-"0.9.3.15"
+"0.9.3.16"