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,da9f9995bafb51df X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.236.170 with SMTP id uv10mr805666pbc.4.1333782362694; Sat, 07 Apr 2012 00:06:02 -0700 (PDT) Path: r9ni28085pbh.0!nntp.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Assigning a "subclass" instance to a "superclass" variable Date: Sat, 07 Apr 2012 08:06:00 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="4453"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YoksXpRoRPOW+8y354JbxlAeUuQjdnrI=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:Aqv2tTxp/g7nObExV9fom/E3gWE= sha1:uPj8ZJd3tN+N4LFqraCX2ywZy4A= Content-Type: text/plain; charset=us-ascii Date: 2012-04-07T08:06:00+01:00 List-Id: deuteros writes: > On Fri 06 Apr 2012 05:50:18p, Simon Wright wrote in > news:m2ty0wh6n9.fsf@pushface.org: > >> with Statements; >> package Expressions is >> type Expression is new Statements.Statement with record >> ... >> end record; >> function Execute (Skip : Boolean; S : Expression) return Integer; >> end Expressions; >> >> or >> >> package Statements.Expressions is >> type Expression is new Statement with record >> ... >> end record; >> function Execute (Skip : Boolean; S : Expression) return Integer; >> end Statements.Expressions; >> >> The second form is good if the full declaration of Statement is in >> the private part of Statements, since child packages can see the >> private parts of their parents. > > Okay, so would I need to put tokens and executedtokens in Expression's > record as well or would it somehow inherit them from Statements? They are inherited. See the Ada 95 Rationale: http://www.adaic.org/resources/add_content/standards/95rat/rat95html/rat95-p1-2.html#1