I'm using SBCL 1.0.29 + lispbuilder-sdl on Mac OS X, trying to develop a (gui) lisp application. I want a cross-platform application with truetype font display of text + interactive graphics - I've gone through possibilities and found out that probably SDL is the best bet. I got the feeling that wxWidgets bindings aka wxCL and Qt bindings for lisp are in a very poor state... because my app will not be 'widget rich' (though a file opening dialog would be very helpful) I think SDL is probably the best. Any other opinions/success stories with other libraries?
The first problem I bumped into is interacting with lisp - I would like the user to be able to talk directly to the lisp from the GUI window - in the same way that one can talk to lisp in the terminal. Right now, the best solution I achieved is that I have an input 'field' in my application where I type in lisp code and when enter is pressed I call something like
- Code: Select all
(eval (read-from-string *user-input*))
in my application and then display the result of 'eval' as the result. If the user makes an error like calling a function that doesn't exist, the debugger starts in the terminal and my application window is closed. I've learned I can handle debugger to some extent by
- Code: Select all
(setf *debugger-hook* #'lisp-debugger)
where #'lisp-debugger is my function, however the result is displayed in the terminal and the application window is closed.
Excuse my n00bness (I've been learning lisp for 6 months) - but how could I include the complete comunication with the lisp within my graphical application (within my window)? How can I make sbcl to output to a string I can display on the screen, rather than in the terminal? In the final version of application I would have only the application window showing without the terminal running sbcl, so I would like to communicate with sbcl like I would in the terminal, from my application. Any advice?