From: Andrew Psaltis <ampsaltis@gmail.com>
To: 10581@debbugs.gnu.org
Subject: bug#10581: exit-hook is undocumented and is not called from a non-interactive environment
Date: Sun, 22 Jan 2012 14:58:51 -0500 [thread overview]
Message-ID: <CAM1tujKQ66Roq5D1UkKQLdcaZdSiO2tNVTa03Z+ctFJ0icZNHg@mail.gmail.com> (raw)
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.
next reply other threads:[~2012-01-22 19:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-22 19:58 Andrew Psaltis [this message]
2012-01-23 2:08 ` bug#10581: exit-hook is undocumented and is not called from a non-interactive environment Ian Price
2012-02-05 11:50 ` Andy Wingo
2012-02-05 19:20 ` Andrew Psaltis
2012-07-06 11:21 ` Andy Wingo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAM1tujKQ66Roq5D1UkKQLdcaZdSiO2tNVTa03Z+ctFJ0icZNHg@mail.gmail.com \
--to=ampsaltis@gmail.com \
--cc=10581@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).