The physical-quantities Reference Manual
Table of Contents
The physical-quantities Reference Manual
This is the physical-quantities Reference Manual, version 0.1,
generated automatically by Declt version 3.0 "Montgomery Scott"
on Tue Dec 22 14:40:03 2020 GMT+0.
1 Introduction
Physical Quantities
This lisp library handles physical quantities which consist of
- Value/Magnitude
- Uncertainty/Error
- Unit
where the type of the value can be any subtype of real
. For the uncertainty, both absolute and relative values are possible. Combinations of lisp symbols or strings are used to describe units. User defined units including abbreviations and prefixes are supported. Error propagation and unit checking is performed for all defined operations.
Example usage
The following example illustrates the use of the library:
(require :asdf)
(asdf:load-system :physical-quantities)
(use-package :physical-quantities}
(define-si-units)
(define-read-macros)
(let (m c e)
;; Define the mass
(setf m #q(1.00 +/- 0.01 kg))
;; The speed of light
(setf c #q(299792458 m / s))
;; e = m * c^2
(setf e (q* m (qpow c 2)))
;; Print e, converted to petajoule
(print #q(e -> PJ)))
This will print
#<QUANTITY 89.87552 +/- 1.0 % petajoule {...}>
Defining quantities
To define a quantity, either the macro (quantity ...)
or the read macro #q(...)
can be used. For the latter, the function (define-read-macros)
must be called first.
The following lines of code are equivalent:
(quantity 1 "kilogram")
(quantity 1 "kg")
(define-read-macros)
#q(1 kilogram)
#q(1 kg)
This creates an object of type quantity
. Its value is the integer 1
and its unit is kilogram
. The uncertainty/error of this quantity is zero because it was not specified. To define it, the symbol +/-
(or +-
), followed by a number, can be inserted into the macro call after the value:
#q(1 +/- 0.2 kg)
This sets the absolute error to 0.2 kg. To define a relative error, the %
sign has to be appended:
#q(1 +/- 20 % kg)
Note that there must be space between numbers and symbols.
It is permitted to use variables or even lisp forms instead of numbers for both the value/magnitude or the uncertainty/error.
Specifying units
Units are specified as a sequence of unit factors. A unit factor is essentially a unit and a power. The power defaults to 1 when only naming the unit (e.g. metre
). If a power of -1 is desired, either the symbol /
or per
can be inserted before the unit (e.g / metre
or per metre
). Powers other than 1 or -1 are specified in any of the following ways:
metre ^ 2
metre ** 2
metre to the 2
/ metre ^ 2
/ metre ** 2
/ metre to the 2
Note that / metre
is equivalent to metre ^ -1
.
For the powers 2 and 3, there are special keywords:
square metre
cubic metre
metre squared
metre cubed
/ square metre
/ cubic metre
/ metre squared
/ metre cubed
As pointed out above, the full unit is a sequence of such unit factors:
kilogram metre ^ 2 / second ^ 2 / kelvin / mole
kg m ^ 2 / s ^ 2 / K / mol
Please note that separating symbols with spaces is compulsory.
Unit abbreviations
Units can be abbreviated. This means that kilometre
is interpreted in the same way as km
. Note that both the unit metre
and the prefix kilo
is abbreviated. Mixing abbreviation (e.g. kmetre
or kilom
) is not supported.
Standalone units
Units without value can be obtained by using one of these methods:
(mkunit "metre" / "second")
(mkunit "m" / "s")
#u(metre / second)
#u(m / s)
These will all create the same unit. Note that the representation of the result may change in the future.
Upper- and lowercase
Lisp by default converts all symbols that it reads to uppercase. This default setting is disabled and case is preserved for units within the #q(...)
and #u(...)
read macros, therefore #q(1 Pa)
has different units from #q(1 pA)
. When using the (quantity ...)
or (mkunit ...)
macros, this is not possible and therefore you would have to specify (quantity 1 "Pa")
or (quantity 1 "pA")
. The macros (quantity ...)
and (mkunit ...)
do accept symbols, but these will be converted to uppercase by the reader (usually causing a unit lookup error) unless they are escaped by using the |...|
syntax for example.
Note that the #q(...)
read macro makes the usual case conversion for the value/magnitude and uncertainty/error. Therefore, it is possible to write
(let ((val 1.0) (err 0.1))
#q(val +/- err m / s))
which will result in #<QUANTITY 1.0 +/- 0.1 metre / second {...}>
. The symbols are converted to uppercase in the let
form as well as in the #q(...)
read macro.
Operations
Common Lisp does not easily allow the redefinition/overloading of standard operators such as +
or *
. For this reason, a number of operators are provided to work with both types real
and quantity
. These are prefixed with the letter q
, e.g. q+
or q*
. Example:
(q* a (q+ b (qsqrt c)))
The result of such an operation is always a quantity, even if all arguments passed to the function are of type real
.
When using these operations, error propagation will be performed automatically. The error propagation is first-order only and correlations are not taken into account.
Defining new operations
Apart from the predefined operations, new options can be defined as normal functions or methods.
See section Accessing value, error and unit for relevant information.
There is a convenience macro defqop
that automatically converts arguments to values of type quantity
if a real
number is passed:
(defqop factorial (number!u)
(unless (errorlessp number)
(error "The error propagation of FACTORIAL is undefined."))
;; Insert more tests here ...
(make-quantity :value (loop for n from 1 upto (value number) for result = 1 then (* result n) finally (return result))))
The list of arguments (here only number!u
) is not a lambda list and things like &optional
or &key
are not allowed.
Furthermore, all arguments are expected to be either of type real
or quantity
.
The ending !u
in number!u
means that the argument number
should automatically be checked for unitlessness.
Otherwise an error will be signaled.
The suffix must only appear in the argument list.
Converting units
Units can be converted by calling the (quantity ...)
or #q(...)
macro and specifying ->
and a new unit:
(let ((v #q(20 m / s)))
(setf v #q(v -> km / h))
(print v))
This would print
#<QUANTITY 72 kilometre / hour {...}>
Instead of using a variable as the first form in the macro call, one could specify any other form such as
#q((q* 1/2 m (qpow v 2)) -> joule)
or even a quantity definition
#q(20 +/- 1 % m / s -> km / h)
Note that it is an error if the units are not convertible.
Limitations
The unit conversion only considers the conversion factor. This means that linear conversions with offset (not to speak of nonlinear conversions) may not work as expected. For example
#q(1 celsius -> kelvin)
will produce 1 kelvin. The offset of 273.15 is ignored. This is fine for conversion of temperature differences, but not for absolute temperatures.
Accessing value, error and unit
To retrieve value/magnitude, uncertainty/error and unit of an object of type quantity
, one can use the functions
(value <quantity>)
to retrieve the value/magnitude
(unit <quantity>)
to retrieve the unit
(absolute-error <quantity>)
or (aerr <quantity>)
to retrieve the absolute uncertainty/error
(relative-error <quantity>)
or (rerr <quantity>
to retrieve the relative uncertainty/error
These are all places, so they are setf
able. Note that setting the absolute uncertainty will affect the relative uncertainty and vice versa. Also note that it is an error accessing the relative error when the value/magnitude is zero.
Machine interface
The macros (quantity ...)
and #q(...)
are intended as convenience for humans. They are not very lispy. To create quantities in a manner that is suitable for machines, the function (make-quantity ...)
is defined:
(make-quantity :value 1 :error 0.1 :error-type :absolute :unit '(("m" 1) ("s" -1)))
This is equivalent to #q(1 +/- 0.1 m / s)
. Note that the unit is a list of unit factors with each unit factor being a symbol or string that stands for a unit and an integer for the power. Being a function, the arguments are evaluated before the quantity
is created. This allows the unit to be a variable. Units can be created with the (make-unit ...)
function:
(make-unit '("m" 1) '("s" -1))
Units can be converted using the (convert-unit ...)
function. It accepts either a unit object or a list of unit factors:
(convert-unit v (make-unit '("km" 1) '("h" -1)))
(convert-unit v '(("km" 1) ("h" -1)))
Defining new units
New units can be defined using the (define-unit ...)
macro:
(define-unit "metre" :abbrev "m" :alias "meter")
(define-unit "watthour" :def (1 "watt" "hour") :abbrev "Wh")
(define-unit "mile" :def (1609344/1000 "metre") :abbrev "mi")
(define-unit "gravity" :def (981/100 "metre" / "second" ^ 2) :abbrev "g")
There are a number of keywords that may appear in the definition:
:def
Specifies the unit in terms of another unit. Complex dependencies can be given such as (0.3048 "metre" / "second" ^ 2)
. If this keyword is missing, the newly defined unit will be considered a base unit.
:alias
Allows multiple (non-abbreviated) names for a unit, given as a single symbol or a list of symbols. This is helpful if there are different spellings (e.g. metre, meter).
:abbrev
Abbreviations for the unit can be specified here, given as a single symbol or a list of symbols. Be careful about name conflicts (see above).
:prefix-test
A function of two arguments, the base and the power, which decides whether a unit prefix is admissible for use with this unit. For more details, see below.
:overwrite
A flag to suppress errors that occur when a naming conflict is detected.
For all defined units and abbreviations, more units with all permissible prefixes such as kilowatthour
or kWh
will automatically be defined.
This may cause naming conflicts which will raise an error.
It is possible to define which prefixes are admissible.
Specifying admissible prefixes
For some units, certain prefixes make no sense. For example: For the unit tonne
, the prefix kilo
is widely used (kilotonne
). It makes little sense, however, to use millitonne
. To specify, which prefixes are admissible, the keyword parameter :prefix-test
can be used in the call to define-unit
. It accepts a function of two arguments, the base and the power of a prefix. The function can then decide, whether such a prefix is admissible by returning T
or NIL
. Here is an example:
(define-unit "tonne" :def (1000 "kilogram") :prefix-test (lambda (base power) (and (= base 10) (>= power 3))))
This will only allow the units tonne
, kilotonne
, megatonne
, etc.
To facilitate the prefix test specification, some functions are provided:
(prefix-base base &optional mod)
Will return a function that accepts only the given base and powers divisible by mod
(defaulting to 1).
(prefix-range base from to)
Will return a function that accepts only the given base and powers in the range between from
and to
(inclusive). To leave the range open on either side, NIL
can be supplied.
(prefix-list base &rest powers)
Will return a function that accepts only the given base and the given powers.
To combine such tests, the following composing functions are provided:
(prefix-and &rest functions)
This will acccept a prefix if all functions accept it.
(prefix-or &rest functions)
This will accept a prefix if a single function accepts it.
You can use the standard composing function complement
where necessary.
The above example could be rewritten to read
(define-unit "tonne" :def (1000 "kilogram") :prefix-test (prefix-range 10 3 nil))
Defining prefixes
Prefixes can be defined by using the (define-unit-prefix ...)
macro:
(define-unit-prefix "giga" 9 :abbrev "G")
(define-unit-prefix "gibi" 3 :abbrev "Gi" :base 1024)
The full name is specified first, followed by the power. Keyword parameters allow the definition of the base (defaults to 10) and abbreviation. In this example, giga
is equivalent to 10^9 and gibi
to 1024^3.
You must define prefixes before defining the units that use them.
Standard units and prefixes
When calling the function (define-si-units &optional clear-existing-units)
, the SI units will be automatically defined. More sets may be available in the future.
Local namespaces
Several unit and prefix definitions can be used in a program by locally defining them. This can be done with the (with-local-units ...)
and (with-saved-units ...
) macros. The former completely clears the outside units and prefixes until control leaves the form. The latter makes a copy of all the unit definitions such that they can be changed within the body of the form without affecting the outisde definitions.
Please note that the unit definitions use dynamic scope an not lexical scope. This means that the unit definitions are only local during the time spent within the macro call. It is therefore not possible to close over the unit definitions. While quantities with local unit can be returned from this macro call, the unit may be undefined after the time of the call or may have a different meaning.
Errors/Conditions
The errors/conditions signaled by the library are all subtypes of physical-quantities-error
which itself is a subtype of standard-error
.
However, no event triggers the physical-quantities-error
directly.
Instead, the most specific error is signaled.
Here is the complete hierarcy of conditions:
-
quantity-definition-error
quantity-definition-syntax-error
: There is a syntax error in one of the following forms: #q(...)
, (quantity ...)
, (make-quantity ...)
, #u(...)
, (make-unit ...)
or (mkunit ...)
.
quantity-definition-semantic-error
: There is a semantic error in one of the following forms: #q(...)
, (quantity ...)
, (make-quantity ...)
, #u(...)
, (make-unit ...)
or (mkunit ...)
.
-
invalid-unit-error
invalid-unit-operation-error
: The mathematical operation can not be performed on the input quantity with the given unit.
invalid-unit-conversion-error
: The units can not be converted into each other.
invalid-unit-reference-error
: The unit is undefined or the prefix unit combination does not exist.
-
operation-undefined-error
: The mathematical operation is undefined for the given input parameters.
-
error-propagation-error
: The propagation of uncertainty can not be performed with the given parameters.
-
unit-definition-error
unit-definition-syntax-error
: A syntactic problem exists with a (define-unit ...)
or (define-prefix ...)
form.
unit-definition-semantic-error
: There is a semantic error with a (define-unit ...)
or (define-prefix ...)
form.
unit-definition-conflict-error
: The unit or prefix is already defined or a combination of prefix and unit conflicts with another unit.
License
Physical Quantities: Lisp Library
Copyright (C) 2017 Marco Rossini
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2 Systems
The main system appears first, followed by any subsystem dependency.
2.1 physical-quantities
- Author
Marco Rossini
- License
GPLv2
- Description
A library that provides a numeric type with optional unit and/or uncertainty for computations with automatic error propagation.
- Version
0.1
- Dependency
parseq
- Source
physical-quantities.asd (file)
- Components
-
3 Files
Files are sorted by type and then listed depth-first from the systems
components trees.
3.1 Lisp
3.1.1 physical-quantities.asd
- Location
physical-quantities.asd
- Systems
physical-quantities (system)
3.1.2 physical-quantities/package.lisp
- Parent
physical-quantities (system)
- Location
package.lisp
- Packages
physical-quantities
3.1.3 physical-quantities/utils.lisp
- Dependency
package.lisp (file)
- Parent
physical-quantities (system)
- Location
utils.lisp
- Internal Definitions
-
3.1.4 physical-quantities/conditions.lisp
- Dependency
utils.lisp (file)
- Parent
physical-quantities (system)
- Location
conditions.lisp
- Exported Definitions
-
- Internal Definitions
-
3.1.5 physical-quantities/unit-factor.lisp
- Dependency
conditions.lisp (file)
- Parent
physical-quantities (system)
- Location
unit-factor.lisp
- Exported Definitions
-
- Internal Definitions
-
3.1.6 physical-quantities/unit-database.lisp
- Dependency
unit-factor.lisp (file)
- Parent
physical-quantities (system)
- Location
unit-database.lisp
- Exported Definitions
-
- Internal Definitions
-
3.1.7 physical-quantities/units.lisp
- Dependency
unit-database.lisp (file)
- Parent
physical-quantities (system)
- Location
units.lisp
- Exported Definitions
-
- Internal Definitions
-
3.1.8 physical-quantities/quantity.lisp
- Dependency
units.lisp (file)
- Parent
physical-quantities (system)
- Location
quantity.lisp
- Exported Definitions
-
- Internal Definitions
-
3.1.9 physical-quantities/numeric.lisp
- Dependency
quantity.lisp (file)
- Parent
physical-quantities (system)
- Location
numeric.lisp
- Exported Definitions
-
- Internal Definitions
-
3.1.10 physical-quantities/parse-rules.lisp
- Dependency
numeric.lisp (file)
- Parent
physical-quantities (system)
- Location
parse-rules.lisp
3.1.11 physical-quantities/read-macro.lisp
- Dependency
parse-rules.lisp (file)
- Parent
physical-quantities (system)
- Location
read-macro.lisp
- Exported Definitions
define-read-macros (function)
- Internal Definitions
-
3.1.12 physical-quantities/si-units.lisp
- Dependency
read-macro.lisp (file)
- Parent
physical-quantities (system)
- Location
si-units.lisp
- Exported Definitions
define-si-units (function)
4 Packages
Packages are listed by definition order.
4.1 physical-quantities
- Source
package.lisp (file)
- Nicknames
-
- Use List
-
- Exported Definitions
-
- Internal Definitions
-
5 Definitions
Definitions are sorted by export status, category, package, and then by
lexicographic order.
5.1 Exported definitions
5.1.1 Macros
- Macro: define-unit NAME &key DEF ALIAS ABBREV PREFIX-TEST OVERWRITE
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Macro: define-unit-prefix NAME POWER &key ABBREV BASE
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Macro: defqop NAME ARG-LIST &body BODY
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Macro: mkunit &rest EXPR
-
Human interface to make a unit.
- Package
physical-quantities
- Source
units.lisp (file)
- Macro: qop QFORM
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Macro: quantity &rest EXPR
-
Function to define quantities without the reader macro.
- Package
physical-quantities
- Source
quantity.lisp (file)
- Macro: with-local-units &body BODY
-
Shadow the global unit table with a new rule table.
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Macro: with-saved-units &body BODY
-
Shadow the global unit table with a copy of the unit table. When returninng from the body the original units are restored.
- Package
physical-quantities
- Source
unit-database.lisp (file)
5.1.2 Functions
- Function: convert-to-base-units QUANTITY
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Function: convert-unit QUANTITY UNIT
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Function: define-read-macros &key QUANTITY UNIT
-
Lets the user define the #q(...) and #u(...) read macros.
- Package
physical-quantities
- Source
read-macro.lisp (file)
- Function: define-si-units &key CLEAR-EXISTING-UNITS
-
- Package
physical-quantities
- Source
si-units.lisp (file)
- Function: make-quantity &key VALUE ERROR ERROR-TYPE UNIT
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Function: make-unit &rest UNIT-FACTORS
-
Machine interface for making a unit.
- Package
physical-quantities
- Source
units.lisp (file)
- Function: q* &rest NUMBERS
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: q+ &rest NUMBERS
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: q- NUMBER &rest MORE-NUMBERS
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: q/ NUMBER &rest MORE-NUMBERS
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: q/= X Y &optional P-VALUE
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qabs NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qacos NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qacosh NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qasin NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qasinh NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qatan NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qatanh NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qcos NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qcosh NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qequal X Y
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qequalp X Y
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qexp EXPONENT
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qexpt BASE EXPONENT
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qln NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qlog NUMBER BASE
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qpow BASE POWER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qroot RADICAND DEGREE
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qround QUANTITY &key DIGITS PLACE
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qsin NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qsinh NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qsqrt QUANTITY
-
Computes the square root of a given quantity. Result must always be real.
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qtan NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: qtanh NUMBER
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: quantityp OBJECT
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Function: str-unit OBJ
-
Prints the given unit in human readable form
- Package
physical-quantities
- Source
units.lisp (file)
- Function: uf-power INSTANCE
-
- Function: (setf uf-power) VALUE INSTANCE
-
- Package
physical-quantities
- Source
unit-factor.lisp (file)
- Function: uf-unit INSTANCE
-
- Function: (setf uf-unit) VALUE INSTANCE
-
- Package
physical-quantities
- Source
unit-factor.lisp (file)
- Function: unitp OBJECT
-
Checks whether an object is a unit.
- Package
physical-quantities
- Source
units.lisp (file)
- Function: units-convertible UNIT-A UNIT-B
-
Expands and reduces both units and compares the unit factors for equality (in unit and power)
- Package
physical-quantities
- Source
units.lisp (file)
- Function: units-equal UNIT-A UNIT-B
-
Reduces both units (without converting to base units) and compares the unit factors for equality (in unit and power)
- Package
physical-quantities
- Source
units.lisp (file)
- Function: units-equalp UNIT-A UNIT-B
-
Reduces both units (converting to base units) and compares the unit factors for equality (in unit and power)
- Package
physical-quantities
- Source
units.lisp (file)
5.1.3 Generic functions
- Generic Function: absolute-error QUANTITY
-
- Generic Function: (setf absolute-error) ERROR QUANTITY
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Methods
- Method: absolute-error (QUANTITY quantity)
-
- Method: (setf absolute-error) ERROR (QUANTITY quantity)
-
- Generic Function: aerr QUANTITY
-
- Generic Function: (setf aerr) ERROR QUANTITY
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Methods
- Method: aerr (QUANTITY quantity)
-
- Method: (setf aerr) ERROR (QUANTITY quantity)
-
- Generic Function: q< X Y &optional P-VALUE
-
Determines whether the one quantity is less than another quantity
- Package
physical-quantities
- Source
numeric.lisp (file)
- Methods
- Method: q< (X quantity) (Y quantity) &optional P-VALUE
-
- Method: q< (X real) (Y quantity) &optional P-VALUE
-
- Method: q< (X quantity) (Y real) &optional P-VALUE
-
- Method: q< (X real) (Y real) &optional P-VALUE
-
- Generic Function: q<= X Y &optional P-VALUE
-
Determines whether the one quantity is less or equal to another quantity
- Package
physical-quantities
- Source
numeric.lisp (file)
- Methods
- Method: q<= (X quantity) (Y quantity) &optional P-VALUE
-
- Method: q<= (X real) (Y quantity) &optional P-VALUE
-
- Method: q<= (X quantity) (Y real) &optional P-VALUE
-
- Method: q<= (X real) (Y real) &optional P-VALUE
-
- Generic Function: q= X Y &optional P-VALUE
-
Determines whether the value of two quantities are equal.
- Package
physical-quantities
- Source
numeric.lisp (file)
- Methods
- Method: q= (X quantity) (Y quantity) &optional P-VALUE
-
- Method: q= (X real) (Y quantity) &optional P-VALUE
-
- Method: q= (X quantity) (Y real) &optional P-VALUE
-
- Method: q= (X real) (Y real) &optional P-VALUE
-
- Generic Function: q> X Y &optional P-VALUE
-
Determines whether the one quantity is greater than another quantity
- Package
physical-quantities
- Source
numeric.lisp (file)
- Methods
- Method: q> (X quantity) (Y quantity) &optional P-VALUE
-
- Method: q> (X real) (Y quantity) &optional P-VALUE
-
- Method: q> (X quantity) (Y real) &optional P-VALUE
-
- Method: q> (X real) (Y real) &optional P-VALUE
-
- Generic Function: q>= X Y &optional P-VALUE
-
Determines whether the one quantity is greater or equal to another quantity
- Package
physical-quantities
- Source
numeric.lisp (file)
- Methods
- Method: q>= (X quantity) (Y quantity) &optional P-VALUE
-
- Method: q>= (X real) (Y quantity) &optional P-VALUE
-
- Method: q>= (X quantity) (Y real) &optional P-VALUE
-
- Method: q>= (X real) (Y real) &optional P-VALUE
-
- Generic Function: relative-error QUANTITY
-
- Generic Function: (setf relative-error) ERROR QUANTITY
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Methods
- Method: relative-error (QUANTITY quantity)
-
- Method: (setf relative-error) ERROR (QUANTITY quantity)
-
- Generic Function: rerr QUANTITY
-
- Generic Function: (setf rerr) ERROR QUANTITY
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Methods
- Method: rerr (QUANTITY quantity)
-
- Method: (setf rerr) ERROR (QUANTITY quantity)
-
- Generic Function: unit OBJECT
-
- Generic Function: (setf unit) NEW-VALUE OBJECT
-
- Package
physical-quantities
- Methods
- Method: unit (QUANTITY quantity)
-
automatically generated reader method
- Source
quantity.lisp (file)
- Method: (setf unit) NEW-VALUE (QUANTITY quantity)
-
automatically generated writer method
- Source
quantity.lisp (file)
- Generic Function: value OBJECT
-
- Generic Function: (setf value) NEW-VALUE OBJECT
-
- Package
physical-quantities
- Methods
- Method: value (QUANTITY quantity)
-
automatically generated reader method
- Source
quantity.lisp (file)
- Method: (setf value) NEW-VALUE (QUANTITY quantity)
-
automatically generated writer method
- Source
quantity.lisp (file)
5.1.4 Conditions
- Condition: error-propagation-error ()
-
Error for situations in which the propagation of uncertainty is undefined
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
physical-quantities-error (condition)
- Condition: invalid-unit-conversion-error ()
-
Error when converting between incompatible units
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
invalid-unit-error (condition)
- Condition: invalid-unit-error ()
-
Generic unit error
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
physical-quantities-error (condition)
- Direct subclasses
-
- Condition: invalid-unit-operation-error ()
-
Error for situations in which the unit is invalid in a given operation
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
invalid-unit-error (condition)
- Condition: invalid-unit-reference-error ()
-
Unit lookup error
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
invalid-unit-error (condition)
- Condition: operation-undefined-error ()
-
Error for situations in which an operation is undefined
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
physical-quantities-error (condition)
- Condition: physical-quantities-error ()
-
Generic error for the physical quantities library.
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
simple-error (condition)
- Direct subclasses
-
- Condition: unit-definition-conflict-error ()
-
Name conflict for the definition of a unit/prefix
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
unit-definition-error (condition)
- Condition: unit-definition-error ()
-
Generic error for unit/prefix definitions.
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
physical-quantities-error (condition)
- Direct subclasses
-
- Condition: unit-definition-semantic-error ()
-
Semantic error in the definition of a unit/prefix
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
unit-definition-error (condition)
- Condition: unit-definition-syntax-error ()
-
Syntax error in the definition of a unit/prefix
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
unit-definition-error (condition)
5.1.5 Classes
- Class: quantity ()
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Direct superclasses
standard-object (class)
- Direct methods
-
- Direct slots
- Slot: value
-
- Initargs
:value
- Initform
0
- Readers
value (generic function)
- Writers
(setf value) (generic function)
- Slot: error
-
- Initargs
:error
- Initform
0
- Readers
error-direct (generic function)
- Writers
(setf error-direct) (generic function)
- Slot: unit
-
- Initargs
:unit
- Readers
unit (generic function)
- Writers
(setf unit) (generic function)
5.2 Internal definitions
5.2.1 Special variables
- Special Variable: *unit-abbreviation-table*
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Special Variable: *unit-alias-table*
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Special Variable: *unit-prefix-table*
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Special Variable: *unit-translation-table*
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
5.2.2 Macros
- Macro: dup-quantity Q &key V E U
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Macro: error-propagation &rest VAR-DERIVATIVE-PAIRS
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Macro: f-error TYPE (&rest INITARGS) CONTROL &rest ARGS
-
Like (error ...), but allows the condition type to be specified (which is required to inherit from simple-condition).
- Package
physical-quantities
- Source
conditions.lisp (file)
- Macro: nand &rest FORMS
-
- Package
physical-quantities
- Source
utils.lisp (file)
- Macro: with-gensyms (&rest NAMES) &body BODY
-
- Package
physical-quantities
- Source
utils.lisp (file)
- Macro: with-unit-lookup (BASE-UNIT TRANSLATION UNIT) &body BODY
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
5.2.3 Functions
- Function: ae VAL ERR
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Function: beta X
-
Helper for the inverf function.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: chebyshev-polynomial N X
-
Evaluates the nth Chebyshev polynomial.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: chebyshev-polynomial% N X A B
-
Recursion function for the Chebyshev polynomial evaluation.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: clear-units ()
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: collect-factors F &rest EXPANDED-UNIT-FACTORS
-
- Package
physical-quantities
- Source
units.lisp (file)
- Function: confidence-interval CONFIDENCE-VALUE &key TWO-SIDED
-
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: convert-unit% VALUE UNIT-A UNIT-B
-
Applies the conversion factor between unit-a and unit-b to the given value.
- Package
physical-quantities
- Source
units.lisp (file)
- Function: copy-hash-table HASH-TABLE
-
Creates a copy of the given hash table.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: copy-unit UNIT
-
Creates a copy of the given unit.
- Package
physical-quantities
- Source
units.lisp (file)
- Function: copy-unit-factor INSTANCE
-
- Package
physical-quantities
- Source
unit-factor.lisp (file)
- Function: define-unit% NAME &key DEF ALIASES ABBREVIATIONS PREFIX-TEST OVERWRITE
-
Defines a new unit with the identifier name. A list of aliases and a list of abbreviations are permitted which - when encountered - are internally converted to the primary identifier. The definition allows the unit to be defined in terms of other units, e.g :def (1.602 kilometre). Prefixes is must be a function of two parameters, the base and the power, with which it decides whether a prefix is allowed for the unit. It defaults to allowing all defined prefixes.
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: define-unit-prefix% NAME POWER &key ABBREV BASE
-
Defines a unit prefix such as kilo in kilometre. Apart from the name the power is required (3 for kilo) together with the base that defaults to 10. An abbreviation for the prefix is also allowed which will be used in combination with abbreviated units.
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: dereference-unit UNIT
-
Takes a unit and looks up aliases and abbreviations of unit factors and replaces them with the main unit designators.
- Package
physical-quantities
- Source
units.lisp (file)
- Function: divide-units &rest UNITS
-
Divides the given units with each, reducing the result.
- Package
physical-quantities
- Source
units.lisp (file)
- Function: erf X
-
Calculates the error function.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: errorlessp QUANTITY
-
Checks whether a quantity is without uncertainty/error.
- Package
physical-quantities
- Source
quantity.lisp (file)
- Function: expand-unit UNIT
-
Expands the given unit into base units and reduces them
- Package
physical-quantities
- Source
units.lisp (file)
- Function: expand-unit-factor FACTOR
-
Converts a single unit factor into its expansion of base units, together with a conversion factor
- Package
physical-quantities
- Source
units.lisp (file)
- Function: has-error-p QUANTITY
-
Checks whether a quantity has uncertainty/error.
- Package
physical-quantities
- Source
quantity.lisp (file)
- Function: has-key KEY HASH-TABLE
-
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: has-unit-p QUANTITY
-
Checks whether the given quantity has a unit.
- Package
physical-quantities
- Source
quantity.lisp (file)
- Function: have ITEM SEQUENCE &key TEST KEY
-
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: inverf X
-
Inverse error function.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: l= LIST LENGTH
-
Tests efficiently whether the length of the list is equal to the given length.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: l> LIST LENGTH
-
Tests efficiently whether the length of the list is greater than the given length.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: ll= LIST-A LIST-B
-
Tests efficiently whether the length of list-a is equal to the length of list-b.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: lookup-unit UNIT
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: make-quantity% &key VALUE ERROR UNIT
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Function: make-uf UNIT POWER
-
- Package
physical-quantities
- Source
unit-factor.lisp (file)
- Function: mklist OBJ
-
Makes a list out of the given object unless it already is a list.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: mkstr &rest ARGS
-
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: multiply-units &rest UNITS
-
Multiplies units with each other and reduces the result.
- Package
physical-quantities
- Source
units.lisp (file)
- Function: p-value X
-
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: power-unit UNIT POWER
-
Raises the unit to the given power.
- Package
physical-quantities
- Source
units.lisp (file)
- Function: prefix-and &rest FUNCTIONS
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: prefix-base BASE &optional MOD
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: prefix-list BASE &rest POWERS
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: prefix-or &rest FUNCTIONS
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: prefix-range BASE POWER-MIN POWER-MAX
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: py+ &rest NUMBERS
-
Pythagorean addition
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: q-op-insert TREE
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: quantile P
-
Calculates the quantile for the normal distribution.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: r-function-a X
-
Helper for the inverf function.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: r-function-b X
-
Helper for the inverf function.
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: re VAL ERR
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Function: read-quantity STREAM CHAR1 CHAR2
-
The read macro #q(...) is an abbreviation for (quantity ...) which does not transform lowercase symbols to uppercase for unit factors.
- Package
physical-quantities
- Source
read-macro.lisp (file)
- Function: read-unit STREAM CHAR1 CHAR2
-
The read macro #u(...) is an abbreviation for (mkunit ...) which does not transform lowercase symbols to uppercase.
- Package
physical-quantities
- Source
read-macro.lisp (file)
- Function: reduce-unit UNIT
-
Reduces the powers of duplicate unit factors in a given unit, e.g. km^2 / km -> km, but m / km -> m / km. No unit lookup is made.
- Package
physical-quantities
- Source
units.lisp (file)
- Function: root-unit UNIT INDEX
-
Extracts the root from the given unit if possible. Converts to base units if necessary.
- Package
physical-quantities
- Source
units.lisp (file)
- Function: round-to NUMBER DIGITS &optional PLACE
-
- Package
physical-quantities
- Source
numeric.lisp (file)
- Function: sort-unit UNIT
-
Sorts the unit by positive and negative powers.
- Package
physical-quantities
- Source
units.lisp (file)
- Function: split TEST SEQUENCE &key KEY
-
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: symb &rest ARGS
-
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: symbol-prefix PREFIX SYMBOLS
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: table-check NAME ALIASES ABBREVS
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: table-insert NAME ALIASES ABBREVS DEF
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: uf-equal A B
-
- Package
physical-quantities
- Source
unit-factor.lisp (file)
- Function: uf-pow UNIT-FACTOR POWER
-
- Package
physical-quantities
- Source
unit-factor.lisp (file)
- Function: unit-factor-p OBJECT
-
- Package
physical-quantities
- Source
unit-factor.lisp (file)
- Function: unit-has-unit-p UNIT
-
- Package
physical-quantities
- Source
units.lisp (file)
- Function: unit-hash-key-check KEY
-
- Package
physical-quantities
- Source
unit-database.lisp (file)
- Function: unitlessp QUANTITY
-
Checks whether the given quantity is unitless.
- Package
physical-quantities
- Source
quantity.lisp (file)
- Function: unzip LIST
-
- Package
physical-quantities
- Source
utils.lisp (file)
- Function: xnor &rest FORMS
-
- Package
physical-quantities
- Source
utils.lisp (file)
5.2.4 Generic functions
- Generic Function: error-direct OBJECT
-
- Generic Function: (setf error-direct) NEW-VALUE OBJECT
-
- Package
physical-quantities
- Methods
- Method: error-direct (QUANTITY quantity)
-
automatically generated reader method
- Source
quantity.lisp (file)
- Method: (setf error-direct) NEW-VALUE (QUANTITY quantity)
-
automatically generated writer method
- Source
quantity.lisp (file)
- Generic Function: eval-quantity VALUE ERROR UNIT-A UNIT-B
-
- Package
physical-quantities
- Source
quantity.lisp (file)
- Methods
- Method: eval-quantity (Q quantity) (ERROR (eql 0)) (UNIT-A (eql nil)) UNIT-B
-
- Method: eval-quantity (Q quantity) (ERROR (eql 0)) UNIT-A (UNIT-B (eql nil))
-
- Method: eval-quantity (VALUE quantity) (ERROR (eql 0)) (UNIT-A (eql nil)) (UNIT-B (eql nil))
-
- Method: eval-quantity (VALUE number) (ERROR number) UNIT-A UNIT-B
-
- Method: eval-quantity (VALUE number) (ERROR number) UNIT-A (UNIT-B (eql nil))
-
5.2.5 Conditions
- Condition: quantity-definition-error ()
-
Generic error for quantity definitions.
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
physical-quantities-error (condition)
- Direct subclasses
-
- Condition: quantity-definition-semantic-error ()
-
Semantic error in the definition of a quantity/unit
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
quantity-definition-error (condition)
- Condition: quantity-definition-syntax-error ()
-
Syntax error in the definition of a quantity/unit
- Package
physical-quantities
- Source
conditions.lisp (file)
- Direct superclasses
quantity-definition-error (condition)
5.2.6 Structures
- Structure: unit-factor ()
-
- Package
physical-quantities
- Source
unit-factor.lisp (file)
- Direct superclasses
structure-object (structure)
- Direct slots
- Slot: unit
-
- Type
string
- Initform
""
- Readers
uf-unit (function)
- Writers
(setf uf-unit) (function)
- Slot: power
-
- Type
integer
- Initform
0
- Readers
uf-power (function)
- Writers
(setf uf-power) (function)
Appendix A Indexes
A.1 Concepts
| Index Entry | | Section |
|
F | | |
| File, Lisp, physical-quantities.asd: | | The physical-quantities․asd file |
| File, Lisp, physical-quantities/conditions.lisp: | | The physical-quantities/conditions․lisp file |
| File, Lisp, physical-quantities/numeric.lisp: | | The physical-quantities/numeric․lisp file |
| File, Lisp, physical-quantities/package.lisp: | | The physical-quantities/package․lisp file |
| File, Lisp, physical-quantities/parse-rules.lisp: | | The physical-quantities/parse-rules․lisp file |
| File, Lisp, physical-quantities/quantity.lisp: | | The physical-quantities/quantity․lisp file |
| File, Lisp, physical-quantities/read-macro.lisp: | | The physical-quantities/read-macro․lisp file |
| File, Lisp, physical-quantities/si-units.lisp: | | The physical-quantities/si-units․lisp file |
| File, Lisp, physical-quantities/unit-database.lisp: | | The physical-quantities/unit-database․lisp file |
| File, Lisp, physical-quantities/unit-factor.lisp: | | The physical-quantities/unit-factor․lisp file |
| File, Lisp, physical-quantities/units.lisp: | | The physical-quantities/units․lisp file |
| File, Lisp, physical-quantities/utils.lisp: | | The physical-quantities/utils․lisp file |
|
L | | |
| Lisp File, physical-quantities.asd: | | The physical-quantities․asd file |
| Lisp File, physical-quantities/conditions.lisp: | | The physical-quantities/conditions․lisp file |
| Lisp File, physical-quantities/numeric.lisp: | | The physical-quantities/numeric․lisp file |
| Lisp File, physical-quantities/package.lisp: | | The physical-quantities/package․lisp file |
| Lisp File, physical-quantities/parse-rules.lisp: | | The physical-quantities/parse-rules․lisp file |
| Lisp File, physical-quantities/quantity.lisp: | | The physical-quantities/quantity․lisp file |
| Lisp File, physical-quantities/read-macro.lisp: | | The physical-quantities/read-macro․lisp file |
| Lisp File, physical-quantities/si-units.lisp: | | The physical-quantities/si-units․lisp file |
| Lisp File, physical-quantities/unit-database.lisp: | | The physical-quantities/unit-database․lisp file |
| Lisp File, physical-quantities/unit-factor.lisp: | | The physical-quantities/unit-factor․lisp file |
| Lisp File, physical-quantities/units.lisp: | | The physical-quantities/units․lisp file |
| Lisp File, physical-quantities/utils.lisp: | | The physical-quantities/utils․lisp file |
|
P | | |
| physical-quantities.asd: | | The physical-quantities․asd file |
| physical-quantities/conditions.lisp: | | The physical-quantities/conditions․lisp file |
| physical-quantities/numeric.lisp: | | The physical-quantities/numeric․lisp file |
| physical-quantities/package.lisp: | | The physical-quantities/package․lisp file |
| physical-quantities/parse-rules.lisp: | | The physical-quantities/parse-rules․lisp file |
| physical-quantities/quantity.lisp: | | The physical-quantities/quantity․lisp file |
| physical-quantities/read-macro.lisp: | | The physical-quantities/read-macro․lisp file |
| physical-quantities/si-units.lisp: | | The physical-quantities/si-units․lisp file |
| physical-quantities/unit-database.lisp: | | The physical-quantities/unit-database․lisp file |
| physical-quantities/unit-factor.lisp: | | The physical-quantities/unit-factor․lisp file |
| physical-quantities/units.lisp: | | The physical-quantities/units․lisp file |
| physical-quantities/utils.lisp: | | The physical-quantities/utils․lisp file |
|
A.2 Functions
| Index Entry | | Section |
|
( | | |
| (setf absolute-error) : | | Exported generic functions |
| (setf absolute-error) : | | Exported generic functions |
| (setf aerr) : | | Exported generic functions |
| (setf aerr) : | | Exported generic functions |
| (setf error-direct) : | | Internal generic functions |
| (setf error-direct) : | | Internal generic functions |
| (setf relative-error) : | | Exported generic functions |
| (setf relative-error) : | | Exported generic functions |
| (setf rerr) : | | Exported generic functions |
| (setf rerr) : | | Exported generic functions |
| (setf uf-power) : | | Exported functions |
| (setf uf-unit) : | | Exported functions |
| (setf unit) : | | Exported generic functions |
| (setf unit) : | | Exported generic functions |
| (setf value) : | | Exported generic functions |
| (setf value) : | | Exported generic functions |
|
A | | |
| absolute-error : | | Exported generic functions |
| absolute-error : | | Exported generic functions |
| ae : | | Internal functions |
| aerr : | | Exported generic functions |
| aerr : | | Exported generic functions |
|
B | | |
| beta : | | Internal functions |
|
C | | |
| chebyshev-polynomial : | | Internal functions |
| chebyshev-polynomial% : | | Internal functions |
| clear-units : | | Internal functions |
| collect-factors : | | Internal functions |
| confidence-interval : | | Internal functions |
| convert-to-base-units : | | Exported functions |
| convert-unit : | | Exported functions |
| convert-unit% : | | Internal functions |
| copy-hash-table : | | Internal functions |
| copy-unit : | | Internal functions |
| copy-unit-factor : | | Internal functions |
|
D | | |
| define-read-macros : | | Exported functions |
| define-si-units : | | Exported functions |
| define-unit : | | Exported macros |
| define-unit% : | | Internal functions |
| define-unit-prefix : | | Exported macros |
| define-unit-prefix% : | | Internal functions |
| defqop : | | Exported macros |
| dereference-unit : | | Internal functions |
| divide-units : | | Internal functions |
| dup-quantity : | | Internal macros |
|
E | | |
| erf : | | Internal functions |
| error-direct : | | Internal generic functions |
| error-direct : | | Internal generic functions |
| error-propagation : | | Internal macros |
| errorlessp : | | Internal functions |
| eval-quantity : | | Internal generic functions |
| eval-quantity : | | Internal generic functions |
| eval-quantity : | | Internal generic functions |
| eval-quantity : | | Internal generic functions |
| eval-quantity : | | Internal generic functions |
| eval-quantity : | | Internal generic functions |
| expand-unit : | | Internal functions |
| expand-unit-factor : | | Internal functions |
|
F | | |
| f-error : | | Internal macros |
| Function, (setf uf-power) : | | Exported functions |
| Function, (setf uf-unit) : | | Exported functions |
| Function, ae : | | Internal functions |
| Function, beta : | | Internal functions |
| Function, chebyshev-polynomial : | | Internal functions |
| Function, chebyshev-polynomial% : | | Internal functions |
| Function, clear-units : | | Internal functions |
| Function, collect-factors : | | Internal functions |
| Function, confidence-interval : | | Internal functions |
| Function, convert-to-base-units : | | Exported functions |
| Function, convert-unit : | | Exported functions |
| Function, convert-unit% : | | Internal functions |
| Function, copy-hash-table : | | Internal functions |
| Function, copy-unit : | | Internal functions |
| Function, copy-unit-factor : | | Internal functions |
| Function, define-read-macros : | | Exported functions |
| Function, define-si-units : | | Exported functions |
| Function, define-unit% : | | Internal functions |
| Function, define-unit-prefix% : | | Internal functions |
| Function, dereference-unit : | | Internal functions |
| Function, divide-units : | | Internal functions |
| Function, erf : | | Internal functions |
| Function, errorlessp : | | Internal functions |
| Function, expand-unit : | | Internal functions |
| Function, expand-unit-factor : | | Internal functions |
| Function, has-error-p : | | Internal functions |
| Function, has-key : | | Internal functions |
| Function, has-unit-p : | | Internal functions |
| Function, have : | | Internal functions |
| Function, inverf : | | Internal functions |
| Function, l= : | | Internal functions |
| Function, l> : | | Internal functions |
| Function, ll= : | | Internal functions |
| Function, lookup-unit : | | Internal functions |
| Function, make-quantity : | | Exported functions |
| Function, make-quantity% : | | Internal functions |
| Function, make-uf : | | Internal functions |
| Function, make-unit : | | Exported functions |
| Function, mklist : | | Internal functions |
| Function, mkstr : | | Internal functions |
| Function, multiply-units : | | Internal functions |
| Function, p-value : | | Internal functions |
| Function, power-unit : | | Internal functions |
| Function, prefix-and : | | Internal functions |
| Function, prefix-base : | | Internal functions |
| Function, prefix-list : | | Internal functions |
| Function, prefix-or : | | Internal functions |
| Function, prefix-range : | | Internal functions |
| Function, py+ : | | Internal functions |
| Function, q* : | | Exported functions |
| Function, q+ : | | Exported functions |
| Function, q- : | | Exported functions |
| Function, q-op-insert : | | Internal functions |
| Function, q/ : | | Exported functions |
| Function, q/= : | | Exported functions |
| Function, qabs : | | Exported functions |
| Function, qacos : | | Exported functions |
| Function, qacosh : | | Exported functions |
| Function, qasin : | | Exported functions |
| Function, qasinh : | | Exported functions |
| Function, qatan : | | Exported functions |
| Function, qatanh : | | Exported functions |
| Function, qcos : | | Exported functions |
| Function, qcosh : | | Exported functions |
| Function, qequal : | | Exported functions |
| Function, qequalp : | | Exported functions |
| Function, qexp : | | Exported functions |
| Function, qexpt : | | Exported functions |
| Function, qln : | | Exported functions |
| Function, qlog : | | Exported functions |
| Function, qpow : | | Exported functions |
| Function, qroot : | | Exported functions |
| Function, qround : | | Exported functions |
| Function, qsin : | | Exported functions |
| Function, qsinh : | | Exported functions |
| Function, qsqrt : | | Exported functions |
| Function, qtan : | | Exported functions |
| Function, qtanh : | | Exported functions |
| Function, quantile : | | Internal functions |
| Function, quantityp : | | Exported functions |
| Function, r-function-a : | | Internal functions |
| Function, r-function-b : | | Internal functions |
| Function, re : | | Internal functions |
| Function, read-quantity : | | Internal functions |
| Function, read-unit : | | Internal functions |
| Function, reduce-unit : | | Internal functions |
| Function, root-unit : | | Internal functions |
| Function, round-to : | | Internal functions |
| Function, sort-unit : | | Internal functions |
| Function, split : | | Internal functions |
| Function, str-unit : | | Exported functions |
| Function, symb : | | Internal functions |
| Function, symbol-prefix : | | Internal functions |
| Function, table-check : | | Internal functions |
| Function, table-insert : | | Internal functions |
| Function, uf-equal : | | Internal functions |
| Function, uf-pow : | | Internal functions |
| Function, uf-power : | | Exported functions |
| Function, uf-unit : | | Exported functions |
| Function, unit-factor-p : | | Internal functions |
| Function, unit-has-unit-p : | | Internal functions |
| Function, unit-hash-key-check : | | Internal functions |
| Function, unitlessp : | | Internal functions |
| Function, unitp : | | Exported functions |
| Function, units-convertible : | | Exported functions |
| Function, units-equal : | | Exported functions |
| Function, units-equalp : | | Exported functions |
| Function, unzip : | | Internal functions |
| Function, xnor : | | Internal functions |
|
G | | |
| Generic Function, (setf absolute-error) : | | Exported generic functions |
| Generic Function, (setf aerr) : | | Exported generic functions |
| Generic Function, (setf error-direct) : | | Internal generic functions |
| Generic Function, (setf relative-error) : | | Exported generic functions |
| Generic Function, (setf rerr) : | | Exported generic functions |
| Generic Function, (setf unit) : | | Exported generic functions |
| Generic Function, (setf value) : | | Exported generic functions |
| Generic Function, absolute-error : | | Exported generic functions |
| Generic Function, aerr : | | Exported generic functions |
| Generic Function, error-direct : | | Internal generic functions |
| Generic Function, eval-quantity : | | Internal generic functions |
| Generic Function, q< : | | Exported generic functions |
| Generic Function, q<= : | | Exported generic functions |
| Generic Function, q= : | | Exported generic functions |
| Generic Function, q> : | | Exported generic functions |
| Generic Function, q>= : | | Exported generic functions |
| Generic Function, relative-error : | | Exported generic functions |
| Generic Function, rerr : | | Exported generic functions |
| Generic Function, unit : | | Exported generic functions |
| Generic Function, value : | | Exported generic functions |
|
H | | |
| has-error-p : | | Internal functions |
| has-key : | | Internal functions |
| has-unit-p : | | Internal functions |
| have : | | Internal functions |
|
I | | |
| inverf : | | Internal functions |
|
L | | |
| l= : | | Internal functions |
| l> : | | Internal functions |
| ll= : | | Internal functions |
| lookup-unit : | | Internal functions |
|
M | | |
| Macro, define-unit : | | Exported macros |
| Macro, define-unit-prefix : | | Exported macros |
| Macro, defqop : | | Exported macros |
| Macro, dup-quantity : | | Internal macros |
| Macro, error-propagation : | | Internal macros |
| Macro, f-error : | | Internal macros |
| Macro, mkunit : | | Exported macros |
| Macro, nand : | | Internal macros |
| Macro, qop : | | Exported macros |
| Macro, quantity : | | Exported macros |
| Macro, with-gensyms : | | Internal macros |
| Macro, with-local-units : | | Exported macros |
| Macro, with-saved-units : | | Exported macros |
| Macro, with-unit-lookup : | | Internal macros |
| make-quantity : | | Exported functions |
| make-quantity% : | | Internal functions |
| make-uf : | | Internal functions |
| make-unit : | | Exported functions |
| Method, (setf absolute-error) : | | Exported generic functions |
| Method, (setf aerr) : | | Exported generic functions |
| Method, (setf error-direct) : | | Internal generic functions |
| Method, (setf relative-error) : | | Exported generic functions |
| Method, (setf rerr) : | | Exported generic functions |
| Method, (setf unit) : | | Exported generic functions |
| Method, (setf value) : | | Exported generic functions |
| Method, absolute-error : | | Exported generic functions |
| Method, aerr : | | Exported generic functions |
| Method, error-direct : | | Internal generic functions |
| Method, eval-quantity : | | Internal generic functions |
| Method, eval-quantity : | | Internal generic functions |
| Method, eval-quantity : | | Internal generic functions |
| Method, eval-quantity : | | Internal generic functions |
| Method, eval-quantity : | | Internal generic functions |
| Method, q< : | | Exported generic functions |
| Method, q< : | | Exported generic functions |
| Method, q< : | | Exported generic functions |
| Method, q< : | | Exported generic functions |
| Method, q<= : | | Exported generic functions |
| Method, q<= : | | Exported generic functions |
| Method, q<= : | | Exported generic functions |
| Method, q<= : | | Exported generic functions |
| Method, q= : | | Exported generic functions |
| Method, q= : | | Exported generic functions |
| Method, q= : | | Exported generic functions |
| Method, q= : | | Exported generic functions |
| Method, q> : | | Exported generic functions |
| Method, q> : | | Exported generic functions |
| Method, q> : | | Exported generic functions |
| Method, q> : | | Exported generic functions |
| Method, q>= : | | Exported generic functions |
| Method, q>= : | | Exported generic functions |
| Method, q>= : | | Exported generic functions |
| Method, q>= : | | Exported generic functions |
| Method, relative-error : | | Exported generic functions |
| Method, rerr : | | Exported generic functions |
| Method, unit : | | Exported generic functions |
| Method, value : | | Exported generic functions |
| mklist : | | Internal functions |
| mkstr : | | Internal functions |
| mkunit : | | Exported macros |
| multiply-units : | | Internal functions |
|
N | | |
| nand : | | Internal macros |
|
P | | |
| p-value : | | Internal functions |
| power-unit : | | Internal functions |
| prefix-and : | | Internal functions |
| prefix-base : | | Internal functions |
| prefix-list : | | Internal functions |
| prefix-or : | | Internal functions |
| prefix-range : | | Internal functions |
| py+ : | | Internal functions |
|
Q | | |
| q* : | | Exported functions |
| q+ : | | Exported functions |
| q- : | | Exported functions |
| q-op-insert : | | Internal functions |
| q/ : | | Exported functions |
| q/= : | | Exported functions |
| q< : | | Exported generic functions |
| q< : | | Exported generic functions |
| q< : | | Exported generic functions |
| q< : | | Exported generic functions |
| q< : | | Exported generic functions |
| q<= : | | Exported generic functions |
| q<= : | | Exported generic functions |
| q<= : | | Exported generic functions |
| q<= : | | Exported generic functions |
| q<= : | | Exported generic functions |
| q= : | | Exported generic functions |
| q= : | | Exported generic functions |
| q= : | | Exported generic functions |
| q= : | | Exported generic functions |
| q= : | | Exported generic functions |
| q> : | | Exported generic functions |
| q> : | | Exported generic functions |
| q> : | | Exported generic functions |
| q> : | | Exported generic functions |
| q> : | | Exported generic functions |
| q>= : | | Exported generic functions |
| q>= : | | Exported generic functions |
| q>= : | | Exported generic functions |
| q>= : | | Exported generic functions |
| q>= : | | Exported generic functions |
| qabs : | | Exported functions |
| qacos : | | Exported functions |
| qacosh : | | Exported functions |
| qasin : | | Exported functions |
| qasinh : | | Exported functions |
| qatan : | | Exported functions |
| qatanh : | | Exported functions |
| qcos : | | Exported functions |
| qcosh : | | Exported functions |
| qequal : | | Exported functions |
| qequalp : | | Exported functions |
| qexp : | | Exported functions |
| qexpt : | | Exported functions |
| qln : | | Exported functions |
| qlog : | | Exported functions |
| qop : | | Exported macros |
| qpow : | | Exported functions |
| qroot : | | Exported functions |
| qround : | | Exported functions |
| qsin : | | Exported functions |
| qsinh : | | Exported functions |
| qsqrt : | | Exported functions |
| qtan : | | Exported functions |
| qtanh : | | Exported functions |
| quantile : | | Internal functions |
| quantity : | | Exported macros |
| quantityp : | | Exported functions |
|
R | | |
| r-function-a : | | Internal functions |
| r-function-b : | | Internal functions |
| re : | | Internal functions |
| read-quantity : | | Internal functions |
| read-unit : | | Internal functions |
| reduce-unit : | | Internal functions |
| relative-error : | | Exported generic functions |
| relative-error : | | Exported generic functions |
| rerr : | | Exported generic functions |
| rerr : | | Exported generic functions |
| root-unit : | | Internal functions |
| round-to : | | Internal functions |
|
S | | |
| sort-unit : | | Internal functions |
| split : | | Internal functions |
| str-unit : | | Exported functions |
| symb : | | Internal functions |
| symbol-prefix : | | Internal functions |
|
T | | |
| table-check : | | Internal functions |
| table-insert : | | Internal functions |
|
U | | |
| uf-equal : | | Internal functions |
| uf-pow : | | Internal functions |
| uf-power : | | Exported functions |
| uf-unit : | | Exported functions |
| unit : | | Exported generic functions |
| unit : | | Exported generic functions |
| unit-factor-p : | | Internal functions |
| unit-has-unit-p : | | Internal functions |
| unit-hash-key-check : | | Internal functions |
| unitlessp : | | Internal functions |
| unitp : | | Exported functions |
| units-convertible : | | Exported functions |
| units-equal : | | Exported functions |
| units-equalp : | | Exported functions |
| unzip : | | Internal functions |
|
V | | |
| value : | | Exported generic functions |
| value : | | Exported generic functions |
|
W | | |
| with-gensyms : | | Internal macros |
| with-local-units : | | Exported macros |
| with-saved-units : | | Exported macros |
| with-unit-lookup : | | Internal macros |
|
X | | |
| xnor : | | Internal functions |
|
A.3 Variables
A.4 Data types
| Index Entry | | Section |
|
C | | |
| Class, quantity : | | Exported classes |
| Condition, error-propagation-error : | | Exported conditions |
| Condition, invalid-unit-conversion-error : | | Exported conditions |
| Condition, invalid-unit-error : | | Exported conditions |
| Condition, invalid-unit-operation-error : | | Exported conditions |
| Condition, invalid-unit-reference-error : | | Exported conditions |
| Condition, operation-undefined-error : | | Exported conditions |
| Condition, physical-quantities-error : | | Exported conditions |
| Condition, quantity-definition-error : | | Internal conditions |
| Condition, quantity-definition-semantic-error : | | Internal conditions |
| Condition, quantity-definition-syntax-error : | | Internal conditions |
| Condition, unit-definition-conflict-error : | | Exported conditions |
| Condition, unit-definition-error : | | Exported conditions |
| Condition, unit-definition-semantic-error : | | Exported conditions |
| Condition, unit-definition-syntax-error : | | Exported conditions |
|
E | | |
| error-propagation-error : | | Exported conditions |
|
I | | |
| invalid-unit-conversion-error : | | Exported conditions |
| invalid-unit-error : | | Exported conditions |
| invalid-unit-operation-error : | | Exported conditions |
| invalid-unit-reference-error : | | Exported conditions |
|
O | | |
| operation-undefined-error : | | Exported conditions |
|
P | | |
| Package, physical-quantities : | | The physical-quantities package |
| physical-quantities : | | The physical-quantities system |
| physical-quantities : | | The physical-quantities package |
| physical-quantities-error : | | Exported conditions |
|
Q | | |
| quantity : | | Exported classes |
| quantity-definition-error : | | Internal conditions |
| quantity-definition-semantic-error : | | Internal conditions |
| quantity-definition-syntax-error : | | Internal conditions |
|
S | | |
| Structure, unit-factor : | | Internal structures |
| System, physical-quantities : | | The physical-quantities system |
|
U | | |
| unit-definition-conflict-error : | | Exported conditions |
| unit-definition-error : | | Exported conditions |
| unit-definition-semantic-error : | | Exported conditions |
| unit-definition-syntax-error : | | Exported conditions |
| unit-factor : | | Internal structures |
|