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-Thread: a07f3367d7,14aa27db81ce3b40 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!s16g2000vbp.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: How to exit an Ada program with (unix shell) error code? Date: Thu, 14 May 2009 02:34:31 -0700 (PDT) Organization: http://groups.google.com Message-ID: <95635a77-2c90-4993-be38-61788ef461d1@s16g2000vbp.googlegroups.com> References: <49ba30c9-a1e6-4346-8618-d256f87ac301@s31g2000vbp.googlegroups.com> <3896e2a7-da0f-4a90-82cf-a776f654a880@b1g2000vbc.googlegroups.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1242293671 30103 127.0.0.1 (14 May 2009 09:34:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 14 May 2009 09:34:31 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s16g2000vbp.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5841 Date: 2009-05-14T02:34:31-07:00 List-Id: Martin wrote on comp.lang.ada: > On May 14, 3:55=A0am, a...@anon.org (anon) wrote: > [snip] > > > Also for Martin. > > > Can a user-created procedure (main subprogram) be concerned as a "publi= c > > parameterless library procedures. =A0No! The reason is that the procedu= re > > is not public, it first must be bound by the binding process. > > > 10.2 =A0(29) An implementation may restrict the kinds of subprograms it > > =A0 =A0 =A0 =A0 =A0 =A0supports as main subprograms. However, an implem= entation is > > =A0 =A0 =A0 =A0 =A0 =A0required to support all main subprograms that ar= e public > > =A0 =A0 =A0 =A0 =A0 =A0parameterless library procedures. > > Ohhh groan.....I think I see what you're trying to say but you've got > the wrong end of the stick. > > It's saying that you can't have this as a main procedure: > > package Application is > private > =A0 =A0procedure Main; =A0 -- NB: in private part of package-decl > end Application; > > =A0 =A0or > > package Application is > =A0 =A0... > end Application; > > package body Application is > =A0 =A0... > =A0 =A0procedure Main; =A0 =A0-- NB: Declaration in body not spec > =A0 =A0... > =A0 =A0procedure Main is > =A0 =A0... > =A0 =A0end Main; > =A0 =A0... > end Application; > > It's not taking about binding (as nothing in the RM talks about > binding). The following is not a "public library procedure" either since it is not declared at library level: package Application is -- package at library level procedure Main; -- subprogram not at library level end Applicatin; There is another non-portable, compiler-dependent possibility which is to not have a main subprogram at all but instead to rely on elaboration: package Application is pragma Elaborate_Body; end Application; package body Application is begin ... end Application; Again the RM does not require the compiler to support this, so this is non-portable. -- Ludovic Brenta.