Commit 21e3a85b authored by Eric Timmons's avatar Eric Timmons Committed by Francois-Rene Rideau

Change apply to funcall in expansion of define-package

SBCL has been getting aggresive with checking arguments to functions. For some
reason (as of SBCL 1.4.1), setting the package source location in define-package
seems to trigger a source translation for the apply form that ends up producing
(many) compilation notes that the arguments to ensure-package in the keyword
positions are not constant, weakening keyword argument checking. We can get
around that, however, by using a funcall directly.
parent ed0f4d5e
...@@ -700,13 +700,13 @@ or when loading the package is optional." ...@@ -700,13 +700,13 @@ or when loading the package is optional."
:and :do (setf use-p t) :else :and :do (setf use-p t) :else
:when (eq kw :unintern) :append args :into unintern :else :when (eq kw :unintern) :append args :into unintern :else
:do (error "unrecognized define-package keyword ~S" kw) :do (error "unrecognized define-package keyword ~S" kw)
:finally (return `(,package :finally (return `(',package
:nicknames ,nicknames :documentation ,documentation :nicknames ',nicknames :documentation ',documentation
:use ,(if use-p use '(:common-lisp)) :use ',(if use-p use '(:common-lisp))
:shadow ,shadow :shadowing-import-from ,shadowing-import-from :shadow ',shadow :shadowing-import-from ',shadowing-import-from
:import-from ,import-from :export ,export :intern ,intern :import-from ',import-from :export ',export :intern ',intern
:recycle ,(if recycle-p recycle (cons package nicknames)) :recycle ',(if recycle-p recycle (cons package nicknames))
:mix ,mix :reexport ,reexport :unintern ,unintern))))) :mix ',mix :reexport ',reexport :unintern ',unintern)))))
(defmacro define-package (package &rest clauses) (defmacro define-package (package &rest clauses)
"DEFINE-PACKAGE takes a PACKAGE and a number of CLAUSES, of the form "DEFINE-PACKAGE takes a PACKAGE and a number of CLAUSES, of the form
...@@ -733,7 +733,7 @@ of shadowing, etc. the symbols with the same name may not be the same symbols. ...@@ -733,7 +733,7 @@ of shadowing, etc. the symbols with the same name may not be the same symbols.
UNINTERN -- Remove symbols here from PACKAGE." UNINTERN -- Remove symbols here from PACKAGE."
(let ((ensure-form (let ((ensure-form
`(prog1 `(prog1
(apply 'ensure-package ',(parse-define-package-form package clauses)) (funcall 'ensure-package ,@(parse-define-package-form package clauses))
#+sbcl (setf (sb-impl::package-source-location (find-package ',package)) #+sbcl (setf (sb-impl::package-source-location (find-package ',package))
(sb-c:source-location))))) (sb-c:source-location)))))
`(progn `(progn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment