comp.lang.ada
 help / color / mirror / Atom feed
From: jls@yoda.Rational.COM (Jim Showalter)
Subject: Re: layered packages
Date: 18 Feb 91 00:16:13 GMT	[thread overview]
Message-ID: <jls.666836173@yoda> (raw)
In-Reply-To: 44213@ut-emx.uucp

I submitted an Ada 9x on this, since I believe that at the point of
derivation you should now get matrix's fetch and store for FREE (this
is how it works in an inheritance language like C++) unless you want
to specifically override the inherited defaults.

Until such time as this is changed, what you do now is write stupid
little "skins" that basically just coerce the types from derived to
base and/or from base to derived, and call the base type's operations.
For example, here is matrix.fetch:

function fetch (from_adt : in adt;
                at_row, at_col : in index) return scalar is
begin
    return low_level.fetch (from_adt => low_level.adt (from_adt),
                           ....);
end fetch;

Barring this little annoyance, I think a derived type is better than
a subtype in this example.
--
***** DISCLAIMER: The opinions expressed herein are my own. Duh. Like you'd
ever be able to find a company (or, for that matter, very many people) with
opinions like mine. 
                   -- "When I want your opinion, I'll beat it out of you."

      parent reply	other threads:[~1991-02-18  0:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-02-15 16:18 layered packages David A. Hasan
1991-02-16 13:32 ` madmats
1991-02-18  0:16 ` Jim Showalter [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox