* fixed a bug in computing method discriminating functions: it is
now possible to define methods specialized on classes which have
forward-referenced superclasses. (thanks to Gerd Moellmann)
+ * fixed evaluation order in optional entries. (reported by Gilbert
+ Baumann)
* fixed some bugs revealed by Paul Dietz' test suite:
** COPY-ALIST now signals an error if its argument is a dotted
list;
During evaluation of the Forms, bind the Vars to the result of evaluating the
Value forms. The variables are bound in parallel after all of the Values are
evaluated."
- (multiple-value-bind (forms decls) (parse-body body nil)
- (multiple-value-bind (vars values) (extract-let-vars bindings 'let)
- (let ((fun-cont (make-continuation)))
- (let* ((*lexenv* (process-decls decls vars nil cont))
- (fun (ir1-convert-lambda-body
- forms vars
- :debug-name (debug-namify "LET ~S" bindings))))
- (reference-leaf start fun-cont fun))
- (ir1-convert-combination-args fun-cont cont values)))))
+ (if (null bindings)
+ (ir1-translate-locally body start cont)
+ (multiple-value-bind (forms decls) (parse-body body nil)
+ (multiple-value-bind (vars values) (extract-let-vars bindings 'let)
+ (let ((fun-cont (make-continuation)))
+ (let* ((*lexenv* (process-decls decls vars nil cont))
+ (fun (ir1-convert-lambda-body
+ forms vars
+ :debug-name (debug-namify "LET ~S" bindings))))
+ (reference-leaf start fun-cont fun))
+ (ir1-convert-combination-args fun-cont cont values))))))
(def-ir1-translator let* ((bindings &body body)
start cont)
:where-from (leaf-where-from var)
:specvar (lambda-var-specvar var)))
fvars))
- (fun (ir1-convert-lambda-body `((%funcall ,fun
- ,@(reverse vals)
- ,@defaults))
- arg-vars
- :debug-name "&OPTIONAL processor"
- :note-lexical-bindings nil)))
+ (fun (collect ((default-bindings)
+ (default-vals))
+ (dolist (default defaults)
+ (if (constantp default)
+ (default-vals default)
+ (let ((var (gensym)))
+ (default-bindings `(,var ,default))
+ (default-vals var))))
+ (ir1-convert-lambda-body `((let (,@(default-bindings))
+ (%funcall ,fun
+ ,@(reverse vals)
+ ,@(default-vals))))
+ arg-vars
+ :debug-name "&OPTIONAL processor"
+ :note-lexical-bindings nil))))
(mapc (lambda (var arg-var)
(when (cdr (leaf-refs arg-var))
(setf (leaf-ever-used var) t)))
((lambda (&optional *x* &rest y) (declare (special *x*)) (values *x* y)) nil))
for real-warns-p = (nth-value 1 (compile nil fun))
do (assert (eq warns-p real-warns-p)))
+
+;;; Bug reported by Gilbert Baumann on #lisp IRC 2003-03-26
+(assert (equal (funcall (eval '(lambda (x &optional (y (pop x))) (list x y)))
+ '(1 2))
+ '((2) 1)))
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.pre8.10"
+"0.pre8.11"