Vl-namedb
Name database structure.
This is a product type introduced by defprod.
Fields
- names — vl-namedb-nameset
- pmap — vl-namedb-prefixmap
- pset — vl-namedb-nameset
Additional Requirements
The following invariant is enforced on the fields:
(and (vl-namedb-pmap-okp names pmap) (vl-namedb-pset-okp pmap pset))
A name db has three fields:
- names, a fast alist that associates strings to t.
- pmap, a fast alist that associates strings to natural numbers.
- pset, a fast alist that associates strings to t.
Invariant. Each prefix bound in pmap is bound to
(vl-pgenstr-highest prefix (alist-keys names)).
Invariant. The pset binds exactly those prefixes that are
bound in pmap.
Intuitively, the names represents the set of all names that are
currently in use. We use a fast-alist representation so that we can very
quickly determine whether a plain name is available.
Meanwhile, the pmap allows us to use something much like the "historic
scheme" (described in vl-namefactory-p) to quickly generate indexed
names. In particular, it binds some prefixes with their highest used index.
This way, we only need to scan the names once per prefix.
The pset is really just an optimization that allows us to avoid needing
to shrink the psets.
Subtopics
- Vl-namedb-fix
- Fixing function for vl-namedb structures.
- Vl-namedb-p
- Recognizer for vl-namedb structures.
- Vl-namedb-equiv
- Basic equivalence relation for vl-namedb structures.
- Make-vl-namedb
- Basic constructor macro for vl-namedb structures.
- Vl-namedb->pset
- Get the pset field from a vl-namedb.
- Vl-namedb->pmap
- Get the pmap field from a vl-namedb.
- Vl-namedb->names
- Get the names field from a vl-namedb.
- Change-vl-namedb
- Modifying constructor for vl-namedb structures.