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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f6ee8ca03c176d76 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-29 08:31:48 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uunet!sea.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: stupid question: how can I finish a program? Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Thu, 29 Aug 2002 15:30:43 GMT References: <5ee5b646.0208241822.34540e8b@posting.google.com> NNTP-Posting-Host: shell01.theworld.com Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:28558 Date: 2002-08-29T15:30:43+00:00 List-Id: Kilgallen@SpamCop.net (Larry Kilgallen) writes: > In article , "Marin D. Condic" writes: > > > There can't be *that* many different ways of killing the process that a > > reasonable compromise answer couldn't be found. What more would be needed > > than a "Kill_The_Process (Optional_Integer_Return_Code_For_Unix_Freaks) ;" > > call? Would it need to be dramatically different between Unix/Windows/Mac? > > Would anyone care if it couldn't be implemented easily on some obscure OS? > > As I recall, you had some VMS background, so VMS is not "obscure" :-) > > 1. With what error code should one exit (odd numbers mean success) ? This question is answered (as well as it can be) by the Ada.Command_Line package. Of course, there is no completely portable answer, but that didn't prevent this useful package from being standardized. > 2. Do you want to run exit handlers in the executable image > and the various shareable images it invoked ? > 3. Do you want to run exit handling in the batch file that > is controlling the program ? The obvious answer is "implementation dependent". The Ada RM has no business talking about VMS-specific features. Note that these questions arise even for programs that exit normally. The Ada RM doesn't address them. The Ada implementer must choose a sensible answer (like, "Yes, exit handlers are run."). > But you cannot avoid running the exit handlers associated with a > privileged shareable image. It is possible to construct a pathelogical > case that will not kill the process since that would damage system > integrity. Consider this analogy: You can use Ada.Text_IO to write a file. The Ada RM says nothing about what happens to that file after the program is done. (For example, there's no guarantee that another Ada program can read that file back in. If the "file" is really the screen, then the data will quickly vanish!) But that doesn't mean that Ada can't define I/O packages -- it just means that part of their useful semantics is outside the universe considered by the Ada RM. The same is true for "exit", or any other feature that interfaces to the world outside the Ada program. Do you avoid writing programs that do I/O, because I/O is inherently non-portable? ;-) - Bob