File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -548,9 +548,19 @@ Optimizations are available for any of:
548548 0
549549 (core :cons-length x)))
550550
551- (deftransform-type-predicate endp null )
552551(deftransform-type-predicate null null )
553552
553+ (deftransform endp (((x (not list ))))
554+ ' (error ' type-error :datum x :expected-type ' list))
555+ (deftransform endp (((x list ))) ' (null x))
556+ ; ; These two are technically redundant since null has a transform,
557+ ; ; but we might as well simplify in one shot, no?
558+ (deftransform endp (((x null ))) t )
559+ (deftransform endp (((x cons ))) nil )
560+ ; ; If all else fails,
561+ (deftransform endp (((x t )))
562+ ' (null (the (values list &rest nil ) x)))
563+
554564; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
555565; ;;
556566; ;; (15) ARRAYS
Original file line number Diff line number Diff line change 1717 (t form)))
1818
1919(define-compiler-macro null (object) ` (if , object nil t ))
20- #- bytecode
21- (define-compiler-macro endp (object)
22- ; ; awkward THE to prevent very inefficient arbitrary-values type check in cclasp
23- ; ; see the notes in opt-number for a little more information
24- ` (if (the (values list &rest nil ) (values , object)) nil t ))
2520
2621(defconstant +nthcdr-inline-limit+ 8 ) ; totally arbitrary
2722
You can’t perform that action at this time.
0 commit comments