comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: stupid question: how can I finish a program?
Date: Thu, 29 Aug 2002 15:30:43 GMT
Date: 2002-08-29T15:30:43+00:00	[thread overview]
Message-ID: <wccr8ghznq4.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: qlKv97ZYiA$w@eisner.encompasserve.org

Kilgallen@SpamCop.net (Larry Kilgallen) writes:

> In article <akin0p$fma$1@nh.pace.co.uk>, "Marin D. Condic" <not.valid@acm.org> 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



  reply	other threads:[~2002-08-29 15:30 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c923f575.0208130627.479e0b3d@posting.google.com>
2002-08-13 14:37 ` stupid question: how can I finish a program? chris.danx
2002-08-13 23:53   ` Robert C. Leif
2002-08-14  2:07     ` Wes Groleau
2002-08-14  5:53       ` Robert C. Leif
2002-08-14 13:30         ` Wes Groleau
2002-08-14 13:56       ` Marin D. Condic
2002-08-17 15:58         ` Robert Dewar
2002-08-14 19:18       ` Simon Wright
2002-08-15 14:02         ` Wes Groleau
2002-08-15  1:47       ` Robert Dewar
2002-08-15  5:14         ` Michael Bode
2002-08-17 14:28           ` Alfred Hilscher
2002-08-15  5:17         ` tmoran
2002-08-15 18:41           ` Robert Dewar
2002-08-14 13:53     ` Marin D. Condic
2002-08-15 17:39       ` tmoran
2002-08-16 13:46         ` Marin D. Condic
2002-08-17 14:26           ` Warren W. Gay VE3WWG
2002-08-22 19:16           ` tmoran
2002-08-22 20:54             ` Marin D. Condic
2002-08-25  2:22       ` Robert Dewar
2002-08-26 15:59         ` Marin D. Condic
2002-08-27 21:59         ` Robert A Duff
2002-08-28 20:40           ` Dmitry A.Kazakov
2002-08-28 13:59             ` Robert A Duff
2002-08-28 16:55               ` Darren New
2002-08-28 18:36                 ` Larry Kilgallen
2002-08-28 22:22                 ` Robert A Duff
2002-08-28 22:30                   ` Darren New
2002-08-28 23:16                     ` Robert A Duff
2002-08-29 16:49                       ` Warren W. Gay VE3WWG
2002-08-29 18:55                         ` Larry Kilgallen
2002-08-29 19:17                           ` Warren W. Gay VE3WWG
2002-08-30  8:09                         ` Ole-Hjalmar Kristensen
2002-08-31 20:39                           ` Warren W. Gay VE3WWG
2002-08-29 16:35                   ` Dennis Lee Bieber
2002-08-29 22:48               ` Dmitry A.Kazakov
2002-08-29 15:18                 ` Robert A Duff
2002-08-30  4:29                   ` Dmitry A.Kazakov
2002-08-29 16:53                     ` Warren W. Gay VE3WWG
2002-08-29 19:03                     ` Robert C. Leif
2002-08-29 19:25                       ` Warren W. Gay VE3WWG
2002-08-29 20:42                       ` Larry Kilgallen
2002-08-29 20:22                         ` Robert A Duff
2002-08-30 20:59                           ` Simon Wright
2002-08-28 14:33             ` Marin D. Condic
2002-08-28 22:15               ` Larry Kilgallen
2002-08-29 15:30                 ` Robert A Duff [this message]
2002-08-29 22:16               ` Dmitry A.Kazakov
2002-08-29 13:17                 ` Marin D. Condic
2002-08-29 19:32                   ` Robert A Duff
2002-08-31  2:40                   ` Dmitry A.Kazakov
2002-08-31  0:10                     ` Toshitaka Kumano
2002-09-02 21:02                       ` Dmitry A.Kazakov
2002-08-29 16:59                 ` Warren W. Gay VE3WWG
2002-08-29 18:26                   ` Marin D. Condic
2002-08-13 14:38 ` David C. Hoos
2002-08-13 20:08   ` Adam Beneschan
2002-08-14  6:41 ` Emil Moholth
2002-08-14 14:00   ` Marin D. Condic
2002-08-14  7:37 ` Martin Dowie
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox