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,910a48a538936849 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!news.germany.com!newsfeed.thomas-huehn.de!news.thomas-huehn.de!newspeer2.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn?= Persson Subject: Re: how to import a package Newsgroups: comp.lang.ada References: <1165371252.358817.57840@80g2000cwy.googlegroups.com> <1165449396.112251.129200@l12g2000cwl.googlegroups.com> User-Agent: KNode/0.10.4 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit Message-ID: <_ZJdh.25636$E02.10609@newsb.telia.net> Date: Thu, 07 Dec 2006 01:18:50 GMT NNTP-Posting-Host: 83.250.96.174 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1165454330 83.250.96.174 (Thu, 07 Dec 2006 02:18:50 CET) NNTP-Posting-Date: Thu, 07 Dec 2006 02:18:50 CET Organization: Telia Internet Xref: g2news2.google.com comp.lang.ada:7835 Date: 2006-12-07T01:18:50+00:00 List-Id: markww wrote: > Yes I'm still confused - sorry - I'm coming from C++ / java and the ada > syntax / scoping is a bit strange to me. So I thought a package is > equivalent to a structure/class. No, a struct in C would be a record in Ada. A class in C++ corresponds to a tagged record type in Ada. C++ doesn't have anything quite like a package; I'd say the closest you get is a namespace. In Java, the classes serve as both data types and packages. Not so in Ada. An Ada package isn't a data type any more than a C++ namespace is. What you have is a generic package. Generics in Ada fill the same role as templates in C++, but they're not quite the same thing. When you instantiate a C++ template you get a class ? a data type. When you instantiate a generic package in Ada you get a package, which can in turn contain data types, subprograms and other things. (Ada also has generic subprograms, but no generic data types.) > So the line: > > Start : Person_List.Node_Ptr; > > doesn't make sense to me since it looks like 'Start' is being defined > as pointing to Person_List.Node_Ptr, when I thought the right side of > the colon must be a data type. Right. Node_Ptr is a data type, and its declaration is to be found in the package Person_List. Start is an object (a variable) of this type. -- Bj�rn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu