Skip to content
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

When -code-watch flag is passed, reload all the code upon resume. #840

Merged
merged 1 commit into from May 14, 2019

Conversation

Projects
None yet
2 participants
@technomancy
Copy link
Contributor

commented May 14, 2019

One of the biggest problems I ran into when working on my latest game jam entry was that the only way to make changes to the game state without restarting the whole game was eval which only takes a line at a time. I wanted to be able to reload my code and resume without wiping game state.

This patch implements that; when it detects that it is in "watch" mode, it automatically reloads all the game's code when you run resume in the console.

However, I'm not convinced that watch mode is the right way to determine whether to reload or not. For codebases that aren't written specifically to support reloading (that is, they do not preserve state in globals to keep them around between loads) resuming can act more like a full reset, which defeats the purpose of resuming; might as well just do run for that. So maybe another option would be to make the command take a param and only do this when someone runs resume reload instead?

I am open to other suggestions too; would love to hear your thoughts.

When --watch flag is passed, reload all the code upon resume.
This allows you to reload without wiping all game state!

But maybe this should be a different flag?
@nesbox

nesbox approved these changes May 14, 2019

Copy link
Owner

left a comment

thank you

@nesbox nesbox merged commit 7369fca into nesbox:master May 14, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@nesbox nesbox added this to the 0.80.0 milestone May 14, 2019

@technomancy technomancy deleted the technomancy:resume-reload branch May 14, 2019

@technomancy technomancy changed the title When --watch flag is passed, reload all the code upon resume. When -code-watch flag is passed, reload all the code upon resume. May 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.