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,6bee08c26af9486d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!d45g2000hsc.googlegroups.com!not-for-mail From: ryan k Newsgroups: comp.lang.ada Subject: Re: Learning Ada but missing the basics? Date: Mon, 30 Jun 2008 18:15:19 -0700 (PDT) Organization: http://groups.google.com Message-ID: <319201bf-2ac0-4a36-a713-ca1db0326541@d45g2000hsc.googlegroups.com> References: <85e95c57-07c3-42eb-b9b9-eac5fd3d0d65@i76g2000hsf.googlegroups.com> NNTP-Posting-Host: 76.118.182.129 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1214874919 20920 127.0.0.1 (1 Jul 2008 01:15:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 1 Jul 2008 01:15:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d45g2000hsc.googlegroups.com; posting-host=76.118.182.129; posting-account=P8pZ2AoAAAC1YVhYH9ynyBsr7IlwH834 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:970 Date: 2008-06-30T18:15:19-07:00 List-Id: On Jun 30, 5:48=A0pm, "Jeffrey R. Carter" wrote: > ryan k wrote: > > I'm trying to learn Ada because a) I think it's cool to learn new > > computer languages and b) it looks like a good one. I've gone the > > through a lot of the tutorials but lets say have package MyPackage and > > 5 subprograms are in the body. Which procedure is run first? Is it > > sequential? Is there some sort of equivalent to C's main()? Is a > > binary created for every package? I guess I don't understand where > > things start and end. Any help or links are greatly appreciated! > > You've clearly missed something. > > Ada is a concurrent language; this answer assumes you haven't created any= tasks. > > The thread of control in an Ada program is called the environment task. I= t > performs elaboration and initialization as needed, calls the main-program > procedure, and finally performs any finalization that's needed. > > The main-program procedure is one that you designate during the building = of the > executable. > > Subprograms in packages are only "run" if they're called. > > Consider the typical hello-world example: > > with Ada.Text_IO; > > procedure Hello is > =A0 =A0 -- null; > begin -- Hello > =A0 =A0 Ada.Text_IO.Put_Line (Item =3D> "Hello, World!"); > end Hello; > > Here, procedure Hello is the main-program procedure. You indicate that wh= en > building the executable. For instance, with GNAT you would put it in a fi= le > named hello.adb and might say > > gnatmake -gnato -fstack-check -O1 hello > > which will create an executable named hello[.platform-dependent-extension= ]. > > Ada.Text_IO is a package which contains a number of subprograms. In this > example, we call its procedure Put_Line. Put_Line may call other subprogr= ams in > Ada.Text_IO or in other packages. These are the only subprograms that are= "run". > > HTH. > > -- > Jeff Carter > "Your mother was a hamster and your father smelt of elderberries." > Monty Python & the Holy Grail > 06 Could anyone point me to an SVN repository for a good, well written open source Ada application?