0.7.9.60:
[sbcl.git] / src / compiler / main.lisp
index e297258..b4c90eb 100644 (file)
 ;;; Process a top level use of LOCALLY, or anything else (e.g.
 ;;; MACROLET) at top level which has declarations and ordinary forms.
 ;;; We parse declarations and then recursively process the body.
-(defun process-toplevel-locally (body path compile-time-too)
+(defun process-toplevel-locally (body path compile-time-too &key vars funs)
   (declare (list path))
   (multiple-value-bind (forms decls) (parse-body body nil)
     (let* ((*lexenv*
-           (process-decls decls nil nil (make-continuation)))
+           (process-decls decls vars funs (make-continuation)))
           ;; Binding *POLICY* is pretty much of a hack, since it
           ;; causes LOCALLY to "capture" enclosed proclamations. It
           ;; is necessary because CONVERT-AND-MAYBE-COMPILE uses the
          (debug-namify "~S initial component" name))
     (setf (component-kind component) :initial)
     (let* ((locall-fun (ir1-convert-lambda
-                       definition
-                       :debug-name (debug-namify "top level local call ~S"
-                                                 name)))
+                        definition
+                        :debug-name (debug-namify "top level local call ~S"
+                                                  name)))
            (fun (ir1-convert-lambda (make-xep-lambda-expression locall-fun)
                                    :source-name (or name '.anonymous.)
                                    :debug-name (unless name
                                                  "top level form"))))
+      (when name
+        (assert-global-function-definition-type name locall-fun))
       (setf (functional-entry-fun fun) locall-fun
             (functional-kind fun) :external
             (functional-has-external-references-p fun) t)
                      ((macrolet)
                       (funcall-in-macrolet-lexenv
                        magic
-                       (lambda ()
+                       (lambda (&key funs)
+                         (declare (ignore funs))
                          (process-toplevel-locally body
                                                    path
                                                    compile-time-too))))
                      ((symbol-macrolet)
                       (funcall-in-symbol-macrolet-lexenv
                        magic
-                       (lambda ()
+                       (lambda (&key vars)
                          (process-toplevel-locally body
                                                    path
-                                                   compile-time-too)))))))
+                                                   compile-time-too
+                                                   :vars vars)))))))
                 ((locally)
                  (process-toplevel-locally (rest form) path compile-time-too))
                 ((progn)