unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#10581: exit-hook is undocumented and is not called from a non-interactive environment
@ 2012-01-22 19:58 Andrew Psaltis
  2012-01-23  2:08 ` Ian Price
  2012-02-05 11:50 ` Andy Wingo
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Psaltis @ 2012-01-22 19:58 UTC (permalink / raw)
  To: 10581

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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-07-06 11:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-22 19:58 bug#10581: exit-hook is undocumented and is not called from a non-interactive environment Andrew Psaltis
2012-01-23  2:08 ` Ian Price
2012-02-05 11:50 ` Andy Wingo
2012-02-05 19:20   ` Andrew Psaltis
2012-07-06 11:21   ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).