(let ((v (make-array 0 :fill-pointer 0)))
(vector-push-extend 1 v)
(copy-seq v))))
+
+;;; to support INLINE functions inside MACROLET, it is necessary for
+;;; FUNCTION-LAMBDA-EXPRESSION to return a proper lambda expression in
+;;; certain circumstances, one of which is when compile is called from
+;;; top-level.
+(assert (equal
+ (function-lambda-expression
+ (compile nil '(lambda (x) (block nil (print x)))))
+ '(lambda (x) (block nil (print x)))))
+
+;;; bug 62: too cautious type inference in a loop
+(assert (nth-value
+ 2
+ (compile nil
+ '(lambda (a)
+ (declare (optimize speed (safety 0)))
+ (typecase a
+ (array (loop (print (car a)))))))))
+
+;;; Bug reported by Robert E. Brown sbcl-devel 2003-02-02: compiler
+;;; failure
+(compile nil
+ '(lambda (key tree collect-path-p)
+ (let ((lessp (key-lessp tree))
+ (equalp (key-equalp tree)))
+ (declare (type (function (t t) boolean) lessp equalp))
+ (let ((path '(nil)))
+ (loop for node = (root-node tree)
+ then (if (funcall lessp key (node-key node))
+ (left-child node)
+ (right-child node))
+ when (null node)
+ do (return (values nil nil nil))
+ do (when collect-path-p
+ (push node path))
+ (when (funcall equalp key (node-key node))
+ (return (values node path t))))))))
+
+;;; CONSTANTLY should return a side-effect-free function (bug caught
+;;; by Paul Dietz' test suite)
+(let ((i 0))
+ (let ((fn (constantly (progn (incf i) 1))))
+ (assert (= i 1))
+ (assert (= (funcall fn) 1))
+ (assert (= i 1))
+ (assert (= (funcall fn) 1))
+ (assert (= i 1))))