gilch / hissp

It's Python with a Lissp.
https://gitter.im/hissp-lang/community
Apache License 2.0
364 stars 9 forks source link

Cache compiled modules #237

Closed gilch closed 11 months ago

gilch commented 11 months ago

This is required for defonce.

transpile will also set __file__.

Python modules are kind of complicated, but this at least gets defonce working, I think. I'm also not caching __main__, which is kind of the default. Making some other default would require deeper changes. I'm assuming that if you're importlib..reloading what's going to be __main__, it's not going to be called that (or the reload would bypass the if __name__ == "__main__" guard and restart your app.

gilch commented 11 months ago

resolves #236