Zulip Chat Archive
Stream: lean4
Topic: Run command at end of every file?
Scott Morrison (Mar 15 2023 at 00:42):
I would like to register a command to run at the end of every (subsequent) file, or alternatively to run after each new declaration is added to the environment. Are either of these possible?
In particular, I'd like explore building the library_search
cache incrementally, using a persistent environment extension. (I would either just persist the state as an Array (Name × Array (DiscrTree.Key))
, and then build the actual DiscrTree
when library_search
is used, or possibly persist the state as an actual DiscrTree
, and provide a function Array DiscrTree → DiscrTree
to merge the saved states from multiple imports.)
Gabriel Ebner (Mar 15 2023 at 00:46):
You could register a linter. They are run after every top-level command.
Jannis Limperg (Mar 15 2023 at 13:30):
FYI I already wrote functions for merging DiscrTree
s. They should be in std
.
Last updated: Dec 20 2023 at 11:08 UTC