Run Io coroutines in background simultaneous to using Io> prompt in foreground?
Since it looks like some people are online answering messages right now, I thought I'd ask a quick question of you. :D
For the game engine I'm working on, I want to be able to have the game running Io scripts in a loop or on threads or coroutines, and be able to pop up an Io> prompt at any time and enter new commands. For instance, I want to be able to have the game moving objects around and displaying an OpenGL loop, yet at any alt-tab over to the terminal I launched Io from and type something like "Monster clone do( attackPlayer() )".
With the prompt presented by the Io executable, if I type something the prompt goes away until it is done, even if I type something like "o1 @test" to launch a coroutine. Is this a fundamental limitation of Io (can't enter new commands while coroutines are running)? I can think of several approaches; which, if any, are right?
1. Type the right Io code (I don't know what it is) at the Io> prompt to get a background thread and retain the Io prompt.
2. Change the C language portion of the Io executable to always launch Io commands in the background (possibly running commandline input on its own OS thread but all the Io coroutines on the same 2nd thread).
3. Write an Io coroutine method that does its own user input to simulate the Io> prompt, and have that eval input strings as coroutines.
Thread createThread("io-string") does exactly what I want in terms of running in the background, but unfortunately it seems these threads do not share the same VM and objects, and the whole point is to be able to manipulate the game objects using an Io> prompt.