Andrew Psaltis writes: > Second: > When I write a scheme script that adds some function to exit-hook, it > is not invoked from a non-interactive call to guile. I have a file > test.scm that looks like so: > > (add-hook! exit-hook (lambda () (display "bye\n"))) > > In an interactive environment: > > $ guile -l test.scm > guile> (exit) > bye > $ > > In a non-interactive environment: > $ guile -s test.scm > $ > > Nothing is printed. As far as I can tell, exit-hook should be made > available in a non-interactive environment so that modules loading > libraries can cleanup easily. Assuming exit-hook is supposed to do this, and I would presume it is meant to. I have a patch which will implement this for stable-2.0. Basically, I wrap everything in a large catch, and when guile gets a 'quit exception it runs the exit hooks before throwing the exception again. As far as I can see, this covers the case where guile exits normally either by use of quit/exit, or just by finishing the script. It does _not_ perform the cleanup if guile quits because of an uncaught exception, but if someone thinks this is desirable, it should be a matter of changing the catch. I'm not quite sure how to add a test case for this though. -- Ian Price "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled"