Commit ddbdecbf authored by Sébastien Villemot's avatar Sébastien Villemot

ECL and CLISP compatibility fix

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.
parent 1af4e458
......@@ -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)))
......@@ -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
......
......@@ -513,7 +513,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))
......@@ -532,7 +532,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)
......
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