comp.lang.ada
 help / color / mirror / Atom feed
From: williams@CRC.SKL.DND.CA (Dave Williamson)
Subject: Re: layering with discriminants
Date: 5 Mar 91 18:00:43 GMT	[thread overview]
Message-ID: <9103051800.AA05744@crc.skl.dnd.ca> (raw)

In INFO-ADA Digest 91-39, David A. Hasan writes:

>GENERIC
>    TYPE size is (<>);
>PACKAGE g_lowLevel IS
>    TYPE adt (i : size) IS PRIVATE;

... lines deleted

>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 NEW low_level.adt(i);
>END g_highLevel;

Refer to LRM 3.7.1(3) - "A discriminant part is only allowed in the type
declaration for a record type, in a private type declaration or an incomplete
type declaration..."

I don't see anything there about derived types.  It appears that your
compiler was correct to reject, but may have led you down the garden path
with its message.

Dave Williamson
Software Kinetics Ltd.
Ottawa Ontario, Canada
williams@crc.skl.dnd.ca

             reply	other threads:[~1991-03-05 18:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-03-05 18:00 Dave Williamson [this message]
  -- strict thread matches above, loose matches on Subject: below --
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
replies disabled

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