On Sat, Jan 17, 2009 at 12:55 PM, Greg Bennett gwbennett@sentex.ca wrote:
As far as I can see from the examples and my readings in the redbook, this sort of cycle is not possible when using OpenGL since the toploop is taken over by the event loop of the graphics processes; when I run the example files I certainly lose access to the repl.
It is possible, but might take some work depending on implementation.
With single threaded SBCL and SLIME with *communication-style* set to :fd-handler, putting (sb-sys:serve-all-events 0) into the main loop somewhere (or an idle callback or similar) makes SLIME's repl usable. Same should work for cmucl, except with system:serve-all-events. Should also work with other swank based IDEs like cusp i think. Other lisps might have a similar mechanism as well.
If you use a lisp with OS level threads and :spawn *communication-style*, you get a usable repl for free (or at most for the cost of starting the app in a separate thread by hand), but things get more complicated due to GL not liking commands from multiple threads without extra setup. That isn't too bad if you only want to modify data or functions though, and not call GL interactively.
With :sigio *communication-style*, things might work automatically, don't remember if i ever tried that or not...
If you don't use slime or something like it, the easiest solution is probably to start using it :) Otherwise, if you have threads, the same situation as with :spawn applies. If not, the best option is probably to implement a simple repl in the main loop.
- -b-