Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sébastien Villemot
antik
Commits
502d6464
Commit
502d6464
authored
Sep 21, 2013
by
Liam M. Healy
Browse files
Check of undefined system of units
parent
e85d75dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
physical-quantities/units.lisp
View file @
502d6464
;; Define physical dimensions and units of measure and systems of units.
;; Liam Healy Wed Feb 27 2002 - 13:18
;; Time-stamp: <2013-0
6-03 12:29:17
EDT units.lisp>
;; Time-stamp: <2013-0
9-21 17:10:40
EDT units.lisp>
;; Copyright 2011, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -212,6 +212,7 @@
(
nf-option
:system-of-units
)
(
make-sysunits
units
system-of-units
))
;;(warn "Set default system of units.")
(
assert
(
nf-option
:system-of-units
)
nil
"System of units ~a is not defined."
system-of-units
)
(
values
))
(
defmacro
with-system-of-units
((
system-of-units
&rest
units
)
&body
body
)
...
...
@@ -371,11 +372,11 @@
(
make-ue
(
/
remainder
cd
))))))))
;;; This is the inverse of parse-unit-sexp
;;; (make-unit-sexp '(2 -4 3 0 0 0 0 0 0))
;;; (make-unit-sexp '(2 -4 3 0 0 0 0 0 0)
t
)
;;; (* (EXPT NEWTON 2) KILOGRAM)
;;; (make-unit-sexp '(-2 1 1 0 0 0 0 0 0))
;;; (make-unit-sexp '(-2 1 1 0 0 0 0 0 0)
t
)
;;; (/ (* KILOGRAM SECOND) (EXPT METER 2))
;;; (make-unit-sexp '(1/2 0 0 0 0 0 0 0 0))
;;; (make-unit-sexp '(1/2 0 0 0 0 0 0 0 0)
t
)
(
defun
make-unit-sexp
(
dimel
scalar-dimensions
)
"From the dimel (list of dimension exponents),
make an unit sexp."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment