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

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 06 Jul 2012 12:17:05 +0000

Your bug report

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

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
10581: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10581
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#10581: exit-hook is undocumented and is not called from a non-interactive environment
From: Andy Wingo <[email-masked]>
To: [email-masked]
Date: Fri, 06 Jul 2012 13:21:41 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Closing out this bug, as it seems that the current situation shouldn't
be changed, and also that atexit sounds sufficient.  Please open a new
report if you still have issues :)

Regards,

Andy
-- 
http://wingolog.org/

Subject: exit-hook is undocumented and is not called from a non-interactive environment
From: Andrew Psaltis <[email-masked]>
To: [email-masked]
Date: Sun, 22 Jan 2012 14:58:51 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Currently using guile version 1.8.8.  I have been told that this also
affects the current upstream version as well.

My current project involves using a C library that has some
initialization and cleanup functions.

First:

The library initialization part is well-handled, but I could not find
a way to do the library cleanup part.  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.

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.