Commit 2a22903a authored by Liam M. Healy's avatar Liam M. Healy
Browse files

Make *unit-information* a hash table

parent 9fcf39af
;; Define physical dimensions and units of measure and systems of units.
;; Liam Healy Wed Feb 27 2002 - 13:18
;; Time-stamp: <2013-05-26 19:29:12EDT units.lisp>
;; Time-stamp: <2013-06-01 09:49:55EDT units.lisp>
;; Copyright 2011, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -44,14 +44,14 @@
;;; Each entry in the table is corresponds to a unit of measure (e.g. 'meter)
;;; or a physical dimension (e.g. 'length) indexed by the symbol.
(defvar *unit-information* nil
(defvar *unit-information* (make-hash-table)
"Properties of each unit of measure and physical dimension.")
(defmacro unit-property (unit property)
"Find or set the particular property of the unit or dimension.
Package of unit does not matter."
`(getf (getf *unit-information*
(alexandria:ensure-symbol ,unit :antik))
`(getf (gethash (alexandria:ensure-symbol ,unit :antik)
*unit-information*)
,property))
;;; The physical dimension is given as a list of exponents of the
......
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