From: eachus@aries.mitre.org (Robert I. Eachus)
Subject: Re: layering with discriminants
Date: 5 Mar 91 01:56:07 GMT [thread overview]
Message-ID: <EACHUS.91Mar4205607@aries.mitre.org> (raw)
In-Reply-To: hasan@emx.utexas.edu's message of 2 Mar 91 00:28:55 GMT
This looks like another "meaningless restriction" for Ada9X to
clean up, but for now it is real. Using Verdix, and wrapping the
declaration as below to make it a record, works fine. This is not the
only case where such a record wrapper is required, I usually run into
it when I want to make the full declaration of a private type a
subtype of another type. Note that I also got "bit" but not as badly
when I decided to make adt a "real" discriminated record...I would
have to pass String as a generic formal array type if I wanted St to
depend on i.
Robert I. Eachus
GENERIC
TYPE size IS (<>);
PACKAGE g_lowLevel IS
TYPE adt (i : size) IS PRIVATE;
PRIVATE
TYPE adt (i : size) IS RECORD
St: String(1..10);
END RECORD;
END g_lowLevel;
WITH g_lowLevel;
GENERIC
TYPE length IS (<>);
PACKAGE g_highLevel IS
TYPE adt (i : length) IS PRIVATE;
PRIVATE
PACKAGE low_level IS NEW g_lowLevel(length);
TYPE adt (i : length) IS RECORD
LL: low_level.adt(i);
END RECORD;
END g_highLevel;
--
Robert I. Eachus
"As far as Saddam Hussein being a great military strategist, he
is neither a strategist, nor is he schooled in the operational arts,
nor is he a tactician, nor is he a general, nor is he as a
soldier...
Other than that he's a great military man. I want you to know that."
-- Gen. H. Norman Schwarzkopf, Saudia Arabia, Feb. 27, 1991
next prev parent reply other threads:[~1991-03-05 1:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-03-02 0:28 layering with discriminants David A. Hasan
1991-03-04 2:52 ` Joe Hollingsworth
1991-03-06 20:12 ` stt
1991-03-05 1:56 ` Robert I. Eachus [this message]
-- strict thread matches above, loose matches on Subject: below --
1991-03-05 18:00 Dave Williamson
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox