Numbered-names
Utilities for numbered names.
A numbered name is a symbol consisting of four parts, in this order:
-
A non-empty base symbol.
-
A non-empty sequence of non-numeric characters
that marks the start of the numeric index,
separating it from the base name.
This character sequence is global but customizable.
-
One of the following:
-
A non-empty sequence of numeric decimal digits not starting with 0,
that forms the numeric index,
which is a positive integer.
-
A non-empty sequence of non-numeric characters
that forms a wildcard for the numeric index.
This character sequence is global but customizable.
-
A possibly empty sequence of non-numeric characters
that marks the end of the numeric index
and that, together with the character sequence in part 2 above,
surrounds the numeric index or the wildcard.
This character sequence is global but customizable.
Examples of numbered names are:
-
MUL2{14}, where
MUL2 is the base name,
{ marks the start of the numeric index,
14 is the numeric index, and
} marks the end of the numeric index.
-
SORT{*}, where
SORT is the base name,
{ marks the start of the numeric index (wildcard),
* is the wildcard, and
} marks the end of the numeric index (wildcard).
-
FIND$3, where
FIND is the base name,
$ marks the start of the numeric index,
3 is the numeric index,
and nothing marks the end of the numeric index.
Numbered names are useful, for instance,
to denote subsequent versions of functions
produced by sequences of transformations,
e.g. foo{1}, foo{2}, ...
Subtopics
- Check-numbered-name
- Check if a symbol is a numbered name.
- Next-numbered-name
- Next numbered name with the same base.
- Resolve-numbered-name-wildcard
- Resolve the wildcard in a numbered name (if any)
to the largest index in use for the name's base.
- Set-numbered-name-index
- Sets the index of a numbered name.
- Next-fresh-numbered-names
- Add to each of the given bases the lowest index,
starting with the given index,
such that the resulting names are not already in use.
- Global-numbered-name-index
- Global index for numbered names.
- Make-numbered-name
- Construct a numbered name from a base and an index (or wildcard).
- Make-numbered-name-list
- Lift make-numbered-name to lists.
- Set-numbered-name-index-to-global
- Sets the index of a numbered name
to the global index for numbered names.
- Numbered-names-in-use
- Numbered names in use.
- Next-fresh-numbered-name
- Specialize next-fresh-numbered-names to a single name.
- Numbered-name-index-wildcard
- Wildcard for the numeric index of numbered names.
- Numbered-name-index-start
- Starting marker of the numeric index of numbered names.
- Numbered-name-index-end
- Ending marker of the numeric index of numbered names.