-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
preventing include-raw reloading #1507
Comments
More information. I mapped over all the There are no two In order to prevent future collisions, we will need to get a longer include path and to There is only one instance with There are 4 instances of
There are 3 instances of
There are many instances of From this information, I think it would probably be fine to ignore the keyword args (except the new |
I think it would be good to experiment with making it an error to undo inclusion of raw Lisp code -- are there cases where we really need to do that or can we avoid it by, say, improving the structuring of books to separate the logical models from their raw Lisp implementations? |
I think we should definitely support undoing include-books that bring in raw Lisp code, such as various Axe tools. Also, I think certify-book often undoes events when it rolls back the world. |
For a book that includes raw Lisp code that shouldn't be undone, it might suffice to put |
Point taken about certify-book undoing events when it rolls back the world. For loading third-party libraries it may be that the best we can do is make sure that re-including the raw Lisp code doesn't change anything, and hope and trust that what doesn't get undone doesn't disrupt anything. Other than that, one common pattern that we probably could support undoing (with help from Matt) is redefining a function under the hood, i.e. clobbering its "logical" symbol-function with a raw Lisp one. E.g. say I include oslib/copy-logic and then oslib/copy, undoing that last include should ideally revert the under-the-hood redefinition of copy-file-fn that was done by loading copy-raw.lsp, and set it back to the symbol-function resulting from its logical definition in copy-logic.lisp. |
:u
does not undo raw lisp code, including that loaded byinclude-raw
.So if you do
Then the internal
include-raw
will be redone.This could be a problem if the contents of the
include-raw
is not idempotent.(It is currently a problem for "zippy" which I will fix in a moment, but I also ran
into a hard-to-reproduce problem with UIOP getting confused about versions of ASDF).
Even if it is idempotent, it could be a performance problem.
I think it is problematic to try to undo arbitrary raw lisp code, so it
would be better to document that raw code is not undone and don't try to undo it.
Also, I think the
include-raw
macro should have a way to prevent the contentsfrom being reloaded. For example, there could be another keyword arg
:always-reload
that defaults tonil
; then the expansion of themacro could define a
defvar
of a flag indicating if the raw code wasalready loaded and then conditionally load the code if the flag was still
NIL
,and then set the flag to
T
.Possible issues with this idea:
If anyone has opinions about this or answers to these questions, please add a comment to this issue
(or send a message via any acl2-related communication).
The text was updated successfully, but these errors were encountered: