# Num-val

Fixtype of numeric value notations.

This is a tagged union type, introduced by fty::deftagsum.

##### Member Tags → Types

`:direct` → num-val-direct
`:range` → num-val-range

In the abstract syntax,
we use lists of natural numbers
for the numeric value notations described in [RFC:2.3],
and pairs of natural numbers
for the value range alternatives described in [RFC:3.4];
both notations are described by the rule num-val (and sub-rules)
in [RFC:4].

We keep information about the numeric base,
i.e. which of the %b, %d, and %x notations is used.
Even though this is irrelevant semantically,
we prefer to retain that information from the concrete syntax
(e.g. for better pretty-printing),
instead of abstracting it away.

We abstract away the restriction
that lists of natural numbers be non-empty.
This restriction is captured by the notion of well-formed numeric value notations, which also requires that the minimum of a range
does not exceed the maximum.

### Subtopics

- Num-val-case
- Case macro for the different kinds of num-val structures.
- Num-val-fix
- Fixing function for num-val structures.
- Num-val-p
- Recognizer for num-val structures.
- Num-val-equiv
- Basic equivalence relation for num-val structures.
- Num-val-range
- Num-val-direct
- Num-val-kind
- Get the
*kind* (tag) of a num-val structure.