-
Notifications
You must be signed in to change notification settings - Fork 370
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
(reload module) doesn't reload Hy modules #712
Comments
reload
doesn't reload/re-execute .hy files
reload
doesn't reload/re-execute .hy files
A simple way to reproduce this (on Python 3) is:
"LOADED" should appear twice, but only appears once. |
Here is a solution in Hy for reloading a file using its path. Useful for reloading from the REPL. (defn slurp [path] (with [f (open path)] (.read f)))
(defn hy-wrap-with-do [s] (+ "(do\n" s "\n)\n"))
(defmacro hy-load [path] `(->> ~path (slurp) (hy-wrap-with-do) (read-str) (eval))) To reload the file The reason for wrapping with The reason for using |
I find It's hard to limit the scope, inner function can limit it, but can't works with we may need |
Shouldn't this issue stay open? The bug remains in Hy master. |
The right solution to this, if we want to put a reload in, is to remove the module from This is what IPython's reloader does - but the reason it doesn't work with Hy is that the reloaded explicitly checks if Now there are a lot of issues with how Hy manipulates Soon! I promise. My free time is at a premium at the moment for personal reasons, but I want to make it a priority. |
No description provided.
The text was updated successfully, but these errors were encountered: