From: Simon Wright <simon@pushface.org>
Subject: Re: Assigning a "subclass" instance to a "superclass" variable
Date: Sat, 07 Apr 2012 08:06:00 +0100
Date: 2012-04-07T08:06:00+01:00 [thread overview]
Message-ID: <m2pqbkggx3.fsf@pushface.org> (raw)
In-Reply-To: jlntb4$pm8$1@dont-email.me
deuteros <deuteros@xrs.net> writes:
> On Fri 06 Apr 2012 05:50:18p, Simon Wright <simon@pushface.org> 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
next prev parent reply other threads:[~2012-04-07 7:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-06 20:49 Assigning a "subclass" instance to a "superclass" variable deuteros
2012-04-06 21:50 ` Simon Wright
2012-04-06 23:13 ` deuteros
2012-04-07 7:06 ` Simon Wright [this message]
2012-04-07 7:06 ` Dmitry A. Kazakov
2012-04-07 7:08 ` Niklas Holsti
2012-04-07 10:18 ` Georg Bauhaus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox