From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!bu.edu!inmet!stt From: stt@inmet.inmet.com Newsgroups: comp.lang.ada Subject: Re: When to run "exit" code Message-ID: <20600046@inmet> Date: 25 May 90 16:00:00 GMT References: <24559@mimsy.umd.edu> Nf-ID: #R:mimsy.umd.edu:24559:inmet:20600046:000:1182 Nf-From: inmet.inmet.com!stt May 25 12:00:00 1990 List-Id: Re: writing "exit-time code" in Ada83 Using priority to accomplish "exit code" (a.k.a. finalization) is non-portable, but will probably work in most mono-processor implementations. I have seen a few other clever tricks, but have unfortunately forgotten them (there might be someone out there on the net with some clever scheme). I know that a number of compilers have a library-level cleanup mechanism, used by their own RTS to close files, etc. You might be able to plug into one of those (still non-portable) mechanisms. In any case, general "finalization" emerged quite early in the Ada9X process as a useful enhancement to Ada. We are considering it quite seriously. When combined with exception handling, abort, terminate, etc., it is far from trivial to define and efficiently implement, but we are trying... C++ has it now, but alas, they don't have those other things (exceptions, etc.). Now that Bjarne Stroustrap is considering adding exceptions to C++, I am sure he will have some interesting things to say about the interactions with finalization (aka "destructors" in C++). S. Tucker Taft Ada9X Mapping/Revision Team Intermetrics, Inc. Cambridge, MA 02138