On Mon, Aug 22, 2011 at 2:28 PM, Ville Voutilainen ville.voutilainen@gmail.com wrote:
On 22 August 2011 15:26, Mark Evenson evenson@panix.com wrote:
Next question: then why is the ProcessingTerminated exception only thrown in the EXT:EXIT and EXT:QUIT implementations? When would we ever expect it to be thrown?
I thought it's thrown from the interpreter when cmdline option parsing fails, and possibly in a couple of other places. There should be a clear difference between exit/quit (which are called) and error cases (which throw).
IIRC, EXT:EXIT/QUIT used to call System.exit but were reengineered to throw ProcessingTerminated to be more application-server friendly, and in general for cases when ABCL is used as a library as you pointed out. I'm not too satisfied either with the current solution, because the use of ABCL as an application rather than a library becomes more complicated, especially with multiple threads. Perhaps when constructing the interpreter one could pass a callback to use for EXIT/QUIT, defaulting to throw ProcessingTerminated in general, and to System.exit when the interpreter is created from org.armedbear.lisp.Main.
Bye, Alessio