0.8.0.34:
[sbcl.git] / src / code / defboot.lisp
index 383c9f3..8df43b2 100644 (file)
            #-sb-xc-host
           (named-lambda `(named-lambda ,name ,@lambda-guts))
           (inline-lambda
-           (cond (;; Does the user not even want to inline?
-                  (not (inline-fun-name-p name))
-                  nil)
-                 (;; Does inlining look too hairy to handle?
-                  (not (sb!c:lambda-independent-of-lexenv-p lambda env))
-                  (sb!c:maybe-compiler-note
-                   "lexical environment too hairy, can't inline DEFUN ~S"
-                   name)
-                  nil)
-                 (t
-                  ;; FIXME: The only reason that we return
-                  ;; LAMBDA-WITH-LEXENV instead of returning bare
-                  ;; LAMBDA is to avoid modifying downstream code
-                  ;; which expects LAMBDA-WITH-LEXENV. But the code
-                  ;; here is the only code which feeds into the
-                  ;; downstream code, and the generality of the
-                  ;; interface is no longer used, so it'd make sense
-                  ;; to simplify the interface instead of using the
-                  ;; old general LAMBDA-WITH-LEXENV interface in this
-                  ;; simplified way.
-                  `(sb!c:lambda-with-lexenv
-                    nil nil nil ; i.e. no DECLS, no MACROS, no SYMMACS
-                    ,@lambda-guts)))))
+           (when (inline-fun-name-p name)
+             ;; we want to attempt to inline, so complain if we can't
+             (or (sb!c:maybe-inline-syntactic-closure lambda env)
+                 (progn
+                   (#+sb-xc-host warn
+                    #-sb-xc-host sb!c:maybe-compiler-note
+                    "lexical environment too hairy, can't inline DEFUN ~S"
+                    name)
+                   nil)))))
       `(progn
 
         ;; In cross-compilation of toplevel DEFUNs, we arrange
 #-sb-xc-host
 (defun %defun (name def doc)
   (declare (type function def))
-  (declare (type (or null simple-string doc)))
+  (declare (type (or null simple-string) doc))
   (aver (legal-fun-name-p name)) ; should've been checked by DEFMACRO DEFUN
   (when (fboundp name)
     (/show0 "redefining NAME in %DEFUN")
   #+nil (setf (%fun-name def) name)
 
   (when doc
-    ;; FIXME: This should use shared SETF-name-parsing logic.
-    (if (and (consp name) (eq (first name) 'setf))
-       (setf (fdocumentation (second name) 'setf) doc)
-       (setf (fdocumentation (the symbol name) 'function) doc)))
+    (setf (fdocumentation name 'function) doc))
   name)
 \f
 ;;;; DEFVAR and DEFPARAMETER
      (declaim (special ,var))
      ,@(when valp
         `((unless (boundp ',var)
-            (setq ,var ,val))))
+            (set ',var ,val))))
      ,@(when docp
         `((setf (fdocumentation ',var 'variable) ',doc )))
      ',var))
   string for the parameter."
   `(progn
      (declaim (special ,var))
-     (setq ,var ,val)
+     (set ',var ,val)
      ,@(when docp
         `((setf (fdocumentation ',var 'variable) ',doc)))
      ',var))
 (defmacro-mundanely lambda (&whole whole args &body body)
   (declare (ignore args body))
   `#',whole)
+
+(defmacro-mundanely named-lambda (&whole whole name args &body body)
+  (declare (ignore name args body))
+  `#',whole)
+
+(defmacro-mundanely lambda-with-lexenv (&whole whole
+                                       declarations macros symbol-macros
+                                       &body body)
+  (declare (ignore declarations macros symbol-macros body))
+  `#',whole)
+
+;;; this eliminates a whole bundle of unknown function STYLE-WARNINGs
+;;; when cross-compiling.  It's not critical for behaviour, but is
+;;; aesthetically pleasing, except inasmuch as there's this list of
+;;; magic functions here.  -- CSR, 2003-04-01
+#+sb-xc-host
+(sb!xc:proclaim '(ftype (function * *)
+                       ;; functions appearing in fundamental defining
+                       ;; macro expansions:
+                       %compiler-deftype
+                       %defun
+                       %defsetf
+                       sb!c:%compiler-defun
+                       sb!c::%define-symbol-macro
+                       sb!c::%defconstant
+                       sb!c::%define-compiler-macro
+                       sb!c::%defmacro
+                       sb!kernel::%compiler-defstruct
+                       sb!kernel::%compiler-define-condition
+                       sb!kernel::%defstruct
+                       sb!kernel::%define-condition
+                       ;; miscellaneous functions commonly appearing
+                       ;; as a result of macro expansions or compiler
+                       ;; transformations:
+                       sb!int:find-undeleted-package-or-lose ; IN-PACKAGE
+                       sb!kernel::arg-count-error ; PARSE-DEFMACRO
+                       ))