Is there some way to add a exit-hook function to abcl so when quit abcl, these functions will be called automatically? Just like sbcl's *exit-hooks*. If not, can I help to add one?
Java lets you do:
Runtime.getRuntime().addShutdownHook( new Thread(){public void run(){/*...*/}});
ABCL lets you call Java and lets Java call your ABCL functions.
If ABCL doesn't already do what you want, something like this will make it:
;in Lisp we want to be able to write (defun my-hook () nil) (sys:exit-hook 'my-hook)
//so let's build some support, in java Runtime r = Runtime.getRuntime(); Lisp.intern("SYS:EXIT-HOOK").setSymbolFunction( new Function(){public void execute(LispObject hook){ r.addShutdownHook(new Thread(){public void run(){ hook.execute();}});}});
I've probably got some method and package names wrong, but that's the gist.
If you don't want to write the Java section above in Java, you can write it in Lisp. But I remember even less of the Lisp to Java syntax, so I won't embarrass myself with any more code.
Vibhu
armedbear-devel@common-lisp.net