unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Andrew Psaltis <ampsaltis@gmail.com>
Cc: 10581@debbugs.gnu.org
Subject: bug#10581: exit-hook is undocumented and is not called from a non-interactive environment
Date: Sun, 05 Feb 2012 12:50:39 +0100	[thread overview]
Message-ID: <87r4y9h52o.fsf@pobox.com> (raw)
In-Reply-To: <CAM1tujKQ66Roq5D1UkKQLdcaZdSiO2tNVTa03Z+ctFJ0icZNHg@mail.gmail.com> (Andrew Psaltis's message of "Sun, 22 Jan 2012 14:58:51 -0500")

Hi Andrew,

On Sun 22 Jan 2012 20:58, Andrew Psaltis <ampsaltis@gmail.com> 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.

> 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.

Andy
-- 
http://wingolog.org/





  parent reply	other threads:[~2012-02-05 11:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=87r4y9h52o.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=10581@debbugs.gnu.org \
    --cc=ampsaltis@gmail.com \
    /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).