[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trigger action at exit?
From: |
Neil Jerram |
Subject: |
Re: Trigger action at exit? |
Date: |
Mon, 03 Mar 2008 22:17:27 +0000 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
address@hidden (Ludovic Courtès) writes:
> Hi,
>
> Neil Jerram <address@hidden> writes:
>
>> In the light of this thread, and another one about atexit in AutoGen,
>> perhaps we should look at providing a Scheme-level at-exit primitive?
>> The main point, I think, would be to guarantee that anything
>> registered by (at-exit ...) or scm_at_exit (...) would run _before_
>> Guile starts doing its own cleanups.
>
> Here, with only Scheme code, `dynamic-wind' should do the job.
>
> In the AutoGen case, where C code is involved, that might be necessary.
> OTOH, the AutoGen folks might as well be able to use `dynamic-wind', who
> knows? :-)
I agree that any main program should be able to handle its own cleanup
using dynamic-wind. What about a library, though?
> (I tend to be reluctant to adding such a thing because it looks
> fragile.)
In what sense fragile?
> Thanks,
> Ludo'.
Regards,
Neil
Re: Trigger action at exit?, John Trammell, 2008/03/03