From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.user Subject: Re: atexit function Date: Sat, 16 Sep 2006 10:32:26 +1000 Message-ID: <87irjowt0l.fsf@zip.com.au> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1158366809 11858 80.91.229.2 (16 Sep 2006 00:33:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 16 Sep 2006 00:33:29 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Sep 16 02:33:26 2006 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GOO7Q-0002Jt-Kf for guile-user@m.gmane.org; Sat, 16 Sep 2006 02:33:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GOO7Q-0008Sw-5q for guile-user@m.gmane.org; Fri, 15 Sep 2006 20:33:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GOO6u-0008Dr-NQ for guile-user@gnu.org; Fri, 15 Sep 2006 20:32:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GOO6s-0008D1-FM for guile-user@gnu.org; Fri, 15 Sep 2006 20:32:43 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GOO6s-0008Cp-3p for guile-user@gnu.org; Fri, 15 Sep 2006 20:32:42 -0400 Original-Received: from [61.8.0.85] (helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GOO98-0007wb-VL for guile-user@gnu.org; Fri, 15 Sep 2006 20:35:03 -0400 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id 7B35D10D310; Sat, 16 Sep 2006 10:32:39 +1000 (EST) Original-Received: from localhost (ppp2431.dyn.pacific.net.au [61.8.36.49]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id k8G0WbvW000760; Sat, 16 Sep 2006 10:32:38 +1000 Original-Received: from gg by localhost with local (Exim 4.63) (envelope-from ) id 1GOO6d-0001lC-5f; Sat, 16 Sep 2006 10:32:27 +1000 Original-To: "Marco Maggi" In-Reply-To: (Marco Maggi's message of "Fri, 15 Sep 2006 16:03:01 +0200") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:5512 Archived-At: "Marco Maggi" 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)". _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user