GNU bug report logs - #10581
exit-hook is undocumented and is not called from a non-interactive environment

Previous Next

Package: guile;

Reported by: Andrew Psaltis <ampsaltis <at> gmail.com>

Date: Sun, 22 Jan 2012 20:33:01 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Andy Wingo <wingo <at> pobox.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#10581: closed (exit-hook is undocumented and is not called
 from a non-interactive environment)
Date: Fri, 06 Jul 2012 12:17:05 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 06 Jul 2012 13:21:41 +0200
with message-id <87fw95yw1m.fsf <at> pobox.com>
and subject line Re: bug#10581: exit-hook is undocumented and is not called from a non-interactive environment
has caused the debbugs.gnu.org bug report #10581,
regarding exit-hook is undocumented and is not called from a non-interactive environment
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
10581: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10581
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Andrew Psaltis <ampsaltis <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: exit-hook is undocumented and is not called from a non-interactive
	environment
Date: Sun, 22 Jan 2012 14:58:51 -0500
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.


[Message part 3 (message/rfc822, inline)]
From: Andy Wingo <wingo <at> pobox.com>
To: 10581-done <at> debbugs.gnu.org
Subject: Re: bug#10581: exit-hook is undocumented and is not called from a
	non-interactive environment
Date: Fri, 06 Jul 2012 13:21:41 +0200
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/


This bug report was last modified 12 years and 323 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.