From: Ken A. <kan...@bb...> - 2003-03-11 21:53:49
|
If you you can manage to do (set! Scheme.EXIT$ #t) the loading of foo.scm would stop. However, there is a bigger issue of runway computation. So i tried putting this code: if (INTERRUPTABLE && Thread.currentThread().interrupted()) throw new JschemeThrowable("Execution was interrupted."); in Scheme.execute() before each procedure call. I've enclosed timings of two tight loops, which shows that when INTERRUPTABLE is #f performance is maybe 3% worse, and when INTERRUPTABLE is #t its about twice as slow. This may not be too bad, because these are worst cases and you don't need to turn INTERRUPTABLE on until you want to use it. An alternative that would be faster would be if (INTERRUPT) { INTERRUPT = false; throw new JschemeThrowable("Execution was interrupted."); } This would interrupt the currently running thread, which may often be the one you want to kill. Let me know what you think. I prefer the first approach. At 07:01 AM 3/9/2003 -0500, Geoffrey Knauth wrote: >Let's say I'm in the middle of loading a file foo.scm. > >I get part of the way through the file, and then I realize some core data structures are messed up. I want to signal an error and stop loading foo.scm, but I may not want to leave the JScheme interpreter. >Can I do that (leave foo.scm but not JScheme)? > >Geoffrey > > > >------------------------------------------------------- >This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com >_______________________________________________ >Jscheme-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user |