AngouriMath

Navigation

Constant


← Back to list of classes

Description

Summary

A mathematical constant: a number whose spelling happens to be a legal identifier.

Remarks

It is a Variable by inheritance, so everything that reads a leaf by name
keeps working, and a distinct type by record identity, which is the whole point: a
binder that declares pi and the constant pi are no longer one object, so
evaluation can tell them apart without being told where it is.
#984
A binder binds occurrences, not values, and that is the whole of the second
distinction here. Every constant a writer types is the one object in
NamedConstants, because the parser and pi hand that
object back; the base of ln and of exp is
EulerIntrinsic, a separate object, because it is Euler's number standing
in an operator's own definition and not a reference to the name e. A binder
replaces the occurrences it was handed — compared by reference — so
sum(ln(x), e, 1, 2) is 2 * ln(x) while sum(log(e, x), e, 1, 2),
where the writer did name e, is log(1, x) + log(2, x).
The two are equal, and deliberately so: they are the same number, they print
alike, and any rule that matches one matches the other, so nothing about canonical form,
equality or substitution changes. Only the identity of the occurrence differs, and only
while a binder is deciding what it binds — which is at construction, before anything
evaluates.

Members

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online