-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
[WIP] Interactive Shell #177
base: canon
Are you sure you want to change the base?
Conversation
I think the busy loop of the pygame-based engine is making this slow to react. |
Haven't looked at the code yet, answering the questions I can first.
This sounds like an ouroboros to me. Do you have an idea of what we'd gain from such? (Well, aside from making a magic builtin work more easily.)
Go for it. If we operate on the assumption that only one engine exists at a time. (We can make that assumption.)
I am unsure I understand the intent of the question?
If we can do it, I'd say this is totally a good idea. |
Regards to Getting the repl to receive events isn't hard. Just write a system with an |
So I updated this so the initial scene is tied to the repl, which is working well. These scene gets stored to the variables Being able to just define event handlers is really nice. Updating them is not. Need to add a thing to allow defining multiple handlers for the same event. Proper Ctrl-C handling feels somewhere between "black magic" and "nigh impossible", so for now I've just disabled it altogether. Also, catch exceptions from repl-defined handlers, so they just get printed instead of crashing the entire engine. Haven't attempted to deal with |
I'm thinking about redoing this. First of all, I think event handlers defined in the repl should run as a system, not on some default scene, removing a lot of magic. I could actually be convinced that running a REPL in parallel to the engine is a bad idea. This would also remove a lot of magic around maintaining REPL coherency. |
Add a REPL mode, allowing you to interact with a live ppb engine.
TODO:
scene
builtin that gets updated?print()
be interjected somehow? Updatingsys.stdout
andsys.stderr
is fraught and tricky (sinceinput()
,readline
, etc use these as well)