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: 103376,ed1ad27c78470510 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!llslave.llan.ll.mit.edu!53ab2750!not-for-mail From: "Frank J. Lhota" User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Main procedure inside a package? References: <1146660038.801976.129790@g10g2000cwb.googlegroups.com> <4458B284.60009@obry.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Wed, 03 May 2006 14:04:12 -0400 NNTP-Posting-Host: 155.34.132.81 X-Complaints-To: news@ll.mit.edu X-Trace: llslave.llan.ll.mit.edu 1146679476 155.34.132.81 (Wed, 03 May 2006 14:04:36 EDT) NNTP-Posting-Date: Wed, 03 May 2006 14:04:36 EDT Xref: g2news2.google.com comp.lang.ada:4049 Date: 2006-05-03T14:04:12-04:00 List-Id: Jean-Pierre Rosen wrote: > Anything can be a main subprogram (the restriction was for 83), however > only parameterless library procedures are guaranteed to be portable: > > LRM 10.2(29): > An implementation may restrict the kinds of subprograms it supports as > main subprograms. However, an implementation is required to support all > main subprograms that are public parameterless library procedures. > > How to define the main subprogram (including the case where it is not a > library procedure) is implementation defined, i.e. RTFM! Even for Ada 83, a main program was not required to be a parameterless library procedure. I recall seeing at least one validated Ada 83 compiler that also allowed the main program to be a library level parameterless function returning an integer. The result of such a function sets the return code of the resulting process. For both Ada 83 and Ada 95, however, the only portable form for a main program is a library parameterless library procedure.