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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,81bb2ce65a3240c3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.236.170 with SMTP id uv10mr14265612pbc.4.1335727968497; Sun, 29 Apr 2012 12:32:48 -0700 (PDT) Path: r9ni113081pbh.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.ecp.fr!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: What would you like in Ada202X? Date: Sun, 29 Apr 2012 21:32:47 +0200 Organization: Ada @ Home Message-ID: References: <3637793.35.1335340026327.JavaMail.geo-discussion-forums@ynfi5> <4f97bf40$0$6559$9b4e6d93@newsspool4.arcor-online.net> <7039631.627.1335610937700.JavaMail.geo-discussion-forums@vbxz8> <10544679.2854.1335718755733.JavaMail.geo-discussion-forums@vbdx11> NNTP-Posting-Host: rXMSOiTd84HHp2Ew/pys9A.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.00 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-04-29T21:32:47+02:00 List-Id: Le Sun, 29 Apr 2012 21:04:34 +0200, Robert A Duff = a =C3=A9crit: > okellogg@users.sourceforge.net writes: > >> Could you elaborate? > > package P is > package Q is > private > end Q; > private > end P; > > package body P is > package body Q is > end Q; > end P; > > In the above nested case: > P spec can see things in Q spec (imagine all sorts of declarations > at various places above). Yes, and that's useful to define a set of preliminary types needed for t= he = definition of a types, which is to be defined in P. Then, I like to do i= t = all in Q, avoiding overlong and bloat name which would inevitably be the= re = if ever another types follow some similar pattern in P. Unfortunately, i= f = you do this, you cannot give Q any child packages, and if you make Q a = child package, it cannot anymore access stuff already defined in p. package P type Comment_Type =E2=80=A6; package Q1 type Role1_Type; type Role2_Type; type Uuseful_Type; -- Useful type defined based on role 1 and role 2 -- and common type. end Q1; subtype Some_Type is Q1.Useful_Type; package Q2 type Role1_Type; type Role2_Type; type Useful_Type; -- Note how the pattern is the same as in Q1. end Q2; subtype Another_Type is Q2.Useful_Type; end P; -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity