From ef8912922c4f8d5d2016b6ed9e9cf2ea9ec3b2f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Tue, 30 Jan 2018 17:02:18 +0100 Subject: [PATCH 1/2] CLISP compatibility fix --- input-output/readtable.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input-output/readtable.lisp b/input-output/readtable.lisp index e6dfd365..d3de2316 100644 --- a/input-output/readtable.lisp +++ b/input-output/readtable.lisp @@ -23,7 +23,7 @@ (named-readtables:defreadtable :antik (:merge :standard) - #-ccl + #-(or ccl clisp) (:macro-char #\# :dispatch)) (defun set-reader (&optional (readtable t) (default-float 'double-float)) -- GitLab From 08b23f1609e78affc7927d3e0699c752935e8ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Tue, 30 Jan 2018 17:11:07 +0100 Subject: [PATCH 2/2] ECL and CLISP compatibility fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some units are defined under symbols from the COMMON-LISP package ("second", "tenth", …). In some implementations (ECL, CLISP), this triggers a package lock error, because those symbols cannot be re-exported in the COMMON-LISP package. --- init/utility.lisp | 5 +++++ input-output/parameters.lisp | 2 +- physical-quantities/units.lisp | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/init/utility.lisp b/init/utility.lisp index a2f78844..dd55b0f2 100644 --- a/init/utility.lisp +++ b/init/utility.lisp @@ -101,3 +101,8 @@ `(if (and (fboundp ',(first test-form)) (funcall ',(first test-form) ,@(rest test-form))) (funcall ',(first then-form) ,@(rest then-form)) ,else-form)) + +(defun export-unless-cl (symbol package) + "Export symbol into package, unless package is COMMON-LISP. Needed for some implementations (ECL, CLISP) that refuse to export an already exported symbol in COMMON-LISP." + (unless (eq package (find-package 'common-lisp)) + (export symbol package))) diff --git a/input-output/parameters.lisp b/input-output/parameters.lisp index e9de6453..6d29b97b 100644 --- a/input-output/parameters.lisp +++ b/input-output/parameters.lisp @@ -112,7 +112,7 @@ (pushnew sym-plain syns) (ensure-package category) (pushnew (find-package category) *categories*) - (export syns (package-name (symbol-package symbol))) + (export-unless-cl syns (symbol-package symbol)) (values symbol syns)))) (defun parameter-post-definition diff --git a/physical-quantities/units.lisp b/physical-quantities/units.lisp index d462a8c0..53b09caa 100644 --- a/physical-quantities/units.lisp +++ b/physical-quantities/units.lisp @@ -518,7 +518,7 @@ "Define the unit. If the definition is a number then the dimension information will be extracted from dimension." ;; Check if name/synonym is already defined. - (export unit (symbol-package unit)) + (export-unless-cl unit (symbol-package unit)) (check-unames unit synonyms) (multiple-value-bind (derived-dim conversion) (if (and dimension (numberp definition)) @@ -537,7 +537,7 @@ (print-name unit) print-name (canonical-name unit) unit) (dolist (syn synonyms) - (export syn (symbol-package syn)) + (export-unless-cl syn (symbol-package syn)) (setf (canonical-name syn) unit)))) (defun define-units (dimension unit-def-syn-pnm) -- GitLab