From bb99b6957941ea4ea57835fad294baf7312b668c Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 10 Aug 2019 01:15:03 +0100 Subject: [PATCH] src/package.lisp, etc.: Muffle warnings about exported symbols etc. SBCL gives big warnings if you re-evaluate a `defpackage' form and it doesn't cover all of the exports and package uses. I simply don't care. --- src/frontend.lisp | 8 +++++--- src/optparse.lisp | 6 ++++-- src/package.lisp | 23 ++++++++++++----------- src/parser/package.lisp | 28 ++++++++++++++++------------ src/utilities.lisp | 16 +++++++++------- 5 files changed, 46 insertions(+), 35 deletions(-) diff --git a/src/frontend.lisp b/src/frontend.lisp index 41f38cd..10b2a6c 100644 --- a/src/frontend.lisp +++ b/src/frontend.lisp @@ -23,9 +23,11 @@ ;;; along with SOD; if not, write to the Free Software Foundation, ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -(cl:defpackage #:sod-frontend - (:use #:common-lisp #:sod-utilities #:optparse #:sod #:sod-parser) - (:shadowing-import-from #:optparse #:int)) +(eval-when (:compile-toplevel :load-toplevel :execute) + (handler-bind ((warning #'muffle-warning)) + (cl:defpackage #:sod-frontend + (:use #:common-lisp #:sod-utilities #:optparse #:sod #:sod-parser) + (:shadowing-import-from #:optparse #:int)))) (cl:in-package #:sod-frontend) diff --git a/src/optparse.lisp b/src/optparse.lisp index a34a7ea..d03b9cc 100644 --- a/src/optparse.lisp +++ b/src/optparse.lisp @@ -23,8 +23,10 @@ ;;; along with SOD; if not, write to the Free Software Foundation, ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -(cl:defpackage #:optparse - (:use #:common-lisp #:sod-utilities)) +(eval-when (:compile-toplevel :load-toplevel :execute) + (handler-bind ((warning #'muffle-warning)) + (cl:defpackage #:optparse + (:use #:common-lisp #:sod-utilities)))) (cl:in-package #:optparse) diff --git a/src/package.lisp b/src/package.lisp index 13466c8..61285db 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -23,17 +23,18 @@ ;;; along with SOD; if not, write to the Free Software Foundation, ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -(cl:defpackage #:sod - (:use #:common-lisp - #:sod-utilities - #:sod-parser)) - -(cl:defpackage #:sod-user - (:use #:common-lisp - #:sod-utilities - #:optparse - #:sod-parser - #:sod)) +(eval-when (:compile-toplevel :load-toplevel :execute) + (handler-bind ((warning #'muffle-warning)) + (cl:defpackage #:sod + (:use #:common-lisp + #:sod-utilities + #:sod-parser)) + (cl:defpackage #:sod-user + (:use #:common-lisp + #:sod-utilities + #:optparse + #:sod-parser + #:sod)))) (cl:in-package #:sod) diff --git a/src/parser/package.lisp b/src/parser/package.lisp index e3e363d..1ce0cfa 100644 --- a/src/parser/package.lisp +++ b/src/parser/package.lisp @@ -23,19 +23,23 @@ ;;; along with SOD; if not, write to the Free Software Foundation, ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -(cl:defpackage #:sod-parser - (:use #:common-lisp - #:sod-utilities +(eval-when (:compile-toplevel :load-toplevel :execute) + (handler-bind ((warning #'muffle-warning)) + (cl:defpackage #:sod-parser + (:use #:common-lisp + #:sod-utilities - ;; Try to find Gray streams support from somewhere. ECL tucks them - ;; somewhere unhelpful. - #.(or (car '(#+sbcl #:sb-gray - #+cmu #:extensions - #+ecl #.(if (find-package '#:gray) '#:gray '#:si) - #+clisp #:gray)) - (error "Unsupported Lisp (can't find Gray streams)"))) + ;; Try to find Gray streams support from somewhere. ECL tucks + ;; them somewhere unhelpful. + #.(or (car '(#+sbcl #:sb-gray + #+cmu #:extensions + #+ecl #.(if (find-package '#:gray) '#:gray '#:si) + #+clisp #:gray)) + (error "Unsupported Lisp (can't find Gray streams)"))) - ;; CMUCL's `extensions' package has lots of cruft. Use our cruft instead. - #+cmu (:shadowing-import-from #:sod-utilities #:symbolicate #:once-only)) + ;; CMUCL's `extensions' package has lots of cruft. Use our cruft + ;; instead. + #+cmu (:shadowing-import-from + #:sod-utilities #:symbolicate #:once-only)))) ;;;----- That's all, folks -------------------------------------------------- diff --git a/src/utilities.lisp b/src/utilities.lisp index e7e1ae2..a496283 100644 --- a/src/utilities.lisp +++ b/src/utilities.lisp @@ -23,13 +23,15 @@ ;;; along with SOD; if not, write to the Free Software Foundation, ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -(cl:defpackage #:sod-utilities - (:use #:common-lisp - - ;; MOP from somewhere. - #+sbcl #:sb-mop - #+(or cmu clisp) #:mop - #+ecl #:clos)) +(eval-when (:compile-toplevel :load-toplevel :execute) + (handler-bind ((warning #'muffle-warning)) + (cl:defpackage #:sod-utilities + (:use #:common-lisp + + ;; MOP from somewhere. + #+sbcl #:sb-mop + #+(or cmu clisp) #:mop + #+ecl #:clos)))) (cl:in-package #:sod-utilities) -- 2.11.0