Subject: bug#10581: exit-hook is undocumented and is not called from a non-interactive environment

From: Andrew Psaltis <[email-masked]>
Date: Sun, 5 Feb 2012 14:20:13 -0500

On Sun, Feb 5, 2012 at 06:50, Andy Wingo <[email-masked]> wrote:
> Hi Andrew,
>
> On Sun 22 Jan 2012 20:58, Andrew Psaltis <[email-masked]> writes:
>
>> After doing some web searches, I found an answer in "exit-hook",
>> except that it was not clear from the Guile reference manual that it
>> existed.  It should probably be documented a little more clearly.
>
> It's not documented at all, actually.  It was added in 1998 to
> boot-9.scm with the following comment:
>
>  ;;; This hook is run at the very end of an interactive session.
>  ;;;
>  (define exit-hook (make-hook))
>
> It has not been changed since then.
>

Ah, yes.

>> When I write a scheme script that adds some function to exit-hook, it
>> is not invoked from a non-interactive call to guile.
>
> Indeed, as the comment notes.
>
> I think it's fair to say that this is a historical interface, and that
> it probably shouldn't be changed.
>
> Why not use atexit(), if you need to clean up the C library?  Just
> wondering.
>

That would be because I forgot that it existed.  I probably should
just use that instead.

Thanks.

~Andrew