Leverage `cl:package`s to implement keymaps?
Ambrevar opened this issue · 0 comments
It just occurred to me that much of the keymap
library lookup mechanism is actually re-implementing how symbols are looked up in packages in Common Lisp.
From the HyperSpec:
11.1.1.2.2 Package Inheritance
Packages can be built up in layers. From one point of view, a package is a single collection of
mappings from strings into internal symbols and external symbols. However, some of these
mappings might be established within the package itself, while other mappings are inherited from
other packages via use-package. A symbol is said to be present in a package if the mapping is
in the package itself and is not inherited from somewhere else.
So if somehow we could have keymap
s subclass cl:package
s, we could greatly simplify the implementation.
But cl:package
is a "system class" which is implemented as a structure in SBCL, so we don't really have much flexibility nor portability here.
Any idea how to address this?