guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: atexit function


From: Kevin Ryde
Subject: Re: atexit function
Date: Sat, 16 Sep 2006 10:32:26 +1000
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

"Marco Maggi" <address@hidden> writes:
>
> Is it possible to have an ATEXIT function? That is:
> an interface to register thunks that are executed
> when the script exits.

I've been using this:

        (define-public (c-atexit proc)
          (let ((old-exit exit))
            (set! exit (lambda args
                         (proc)
                         (apply old-exit args)))))

to hang code on the exit func.  Unfortunately the normal "guile -s" to
run a script doesn't go via that function, so it only works if you
explicitly "(exit 0)".




reply via email to

[Prev in Thread] Current Thread [Next in Thread]