comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: Extensions in generic bodies - Language Laywer question
Date: 1998/10/08
Date: 1998-10-08T00:00:00+00:00	[thread overview]
Message-ID: <EACHUS.98Oct8151930@spectre.mitre.org> (raw)
In-Reply-To: 6vijho$qps$1@nnrp1.dejanews.com

In article <6vijho$qps$1@nnrp1.dejanews.com> dennison@telepath.com writes:

  > Here's one for the langauge Laywers. 3.9.1(4) says: "A type extension shall
  > not be declared in a generic body if the parent type is declared
  > outside that body."

  Yes, it has to do with dispatch tables.  The same problem occurs
with non-generic bodies, but other rules ensure that the problem cases
can never occur.

  > Does that also go for instantiating generics that *cause* a type
  > extension? My compiler seems to think so.

  Yes.

  > My situation: I'm trying to create a generic object. Internally
  > (In the body) I want to keep a queue of these objects...

  In this case, you should be able to declare the type in the private
part, and I remember that as the reason for keeping the rule simple.
In any case that can be made to work, the type declaration can be
moved to (the private part of) the generic spec.  This may, as in the
current case, also require moving with clauses.  (In pathological
cases, you have to move the declaration to a new child unit.)
--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




      reply	other threads:[~1998-10-08  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-08  0:00 Extensions in generic bodies - Language Laywer question dennison
1998-10-08  0:00 ` Robert I. Eachus [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