Unverified Commit 08b23f16 authored by Sébastien Villemot's avatar Sébastien Villemot Committed by Sébastien Villemot
Browse files

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 ef891292
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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)))
+1 −1
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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)