Index: /trunk/ccl/compiler/nx0.lisp
===================================================================
--- /trunk/ccl/compiler/nx0.lisp	(revision 5339)
+++ /trunk/ccl/compiler/nx0.lisp	(revision 5340)
@@ -1847,5 +1847,5 @@
         (make-acode (%nx1-operator self-call) (nx1-arglist args args-in-regs) spread-p))
       (multiple-value-bind (lambda-form containing-env token) (nx-inline-expansion sym *nx-lexical-environment* global-only)
-        (or (nx1-expand-inline-call lambda-form containing-env token args spread-p)
+        (or (nx1-expand-inline-call lambda-form containing-env token args spread-p *nx-lexical-environment*)
             (multiple-value-bind (info afunc) (if (and  (symbolp sym) (not global-only)) (nx-lexical-finfo sym))
               (when (eq 'macro (car info))
@@ -1868,13 +1868,20 @@
                       val)))))))))
 
-(defun nx1-expand-inline-call (lambda-form env token args spread-p)
+(defun nx1-expand-inline-call (lambda-form env token args spread-p old-env)
   (if (and (or (null spread-p) (eq (length args) 1)))
     (if (and token (not (memq token *nx-inline-expansions*)))
       (let* ((*nx-inline-expansions* (cons token *nx-inline-expansions*))
              (lambda-list (cadr lambda-form))
-             (body (cddr lambda-form)))
+             (body (cddr lambda-form))
+             (new-env (new-lexical-environment env)))
+        (setf (lexenv.mdecls new-env)
+                `((speed . ,(speed-optimize-quantity old-env))
+                           (space . ,(space-optimize-quantity old-env))
+                           (safety . ,(space-optimize-quantity old-env))
+                           (compilation-speed . ,(compilation-speed-optimize-quantity old-env))
+                           (debug . ,(debug-optimize-quantity old-env))))
         (if spread-p
-          (nx1-destructure lambda-list (car args) nil nil body env)
-          (nx1-lambda-bind lambda-list args body env))))))
+          (nx1-destructure lambda-list (car args) nil nil body new-env)
+          (nx1-lambda-bind lambda-list args body new-env))))))
              
 ; note that regforms are reversed: arg_z is always in the car
