Functions for filtering lists of parsed objects by their names.
We implement functions for keeping and deleting objects by their
names, and also for partitioning lists of objects into named and unnamed
These functions are logically simple, but we use MBE to make them fairly
efficient. In particular, suppose we want to keep, delete, or filter the list
x using some list of names.
- If there are only a few names, we use naive algorithm that calls member-equal repeatedly, and this is effectively O(|x|).
- When there are many names, we use make-lookup-alist to construct a
temporary, fast alist, and use fast-memberp to perform the lookups.
Assuming that hashing operations are constant time, constructing this table is
O(|names|), and the subsequent processing of x is O(|x|).
These functions preserve the order of the initial list. The order of
names is irrelevant, and any spurious names that aren't among the
names of x are simply ignored.
See also finding-by-name for related functions that can also be used
to look up objects by their names and to rearrange objects by their
- Keep vl-modinst-ps by modname.
- Keep vl-modinst-ps by instname.
- Delete vl-modinsts by instname.
- Keep vl-import-ps by package.
- Delete vl-modinsts by modname.
- Keep vl-description-ps by name.
- Delete vl-imports by package.
- Delete vl-descriptions by name.
- Delete vl-paramdecls by name.
- Delete vl-interfaces by name.
- Keep vl-taskdecl-ps by name.
- Keep vl-portdecl-ps by name.
- Keep vl-paramdecl-ps by name.
- Keep vl-interface-ps by name.
- Keep vl-vardecl-ps by name.
- Keep vl-typedef-ps by name.
- Keep vl-program-ps by name.
- Keep vl-package-ps by name.
- Keep vl-fundecl-ps by name.
- Delete vl-taskdecls by name.
- Delete vl-portdecls by name.
- Keep vl-module-ps by name.
- Keep vl-config-ps by name.
- Keep vl-class-ps by name.
- Delete vl-vardecls by name.
- Delete vl-typedefs by name.
- Delete vl-programs by name.
- Delete vl-packages by name.
- Delete vl-modules by name.
- Delete vl-fundecls by name.
- Delete vl-configs by name.
- Delete vl-classs by name.
- Keep vl-udp-ps by name.
- Delete vl-udps by name.
- Same as vl-filter-modinsts-by-modname, but requires that the
fast alist of names be provided instead of recomputing it.
- Partition a list of vl-modinsts by modname.
- Partition a list of vl-modinsts by instname.
- Partition a list of vl-imports by package.
- Partition a list of vl-descriptions by name.
- Partition a list of vl-vardecls by name.
- Partition a list of vl-typedefs by name.
- Partition a list of vl-taskdecls by name.
- Partition a list of vl-programs by name.
- Partition a list of vl-portdecls by name.
- Partition a list of vl-paramdecls by name.
- Partition a list of vl-packages by name.
- Partition a list of vl-modules by name.
- Partition a list of vl-interfaces by name.
- Partition a list of vl-fundecls by name.
- Partition a list of vl-configs by name.
- Partition a list of vl-classs by name.
- Partition a list of vl-udps by name.