comp.lang.ada
 help / color / mirror / Atom feed
* Re: discriminants and tagged types
       [not found] <01bdd676$82f6cfa0$f330ea9e@ukp03332>
  1998-09-02  0:00 ` discriminants and tagged types Robert I. Eachus
@ 1998-09-02  0:00 ` Tucker Taft
  1 sibling, 0 replies; 2+ messages in thread
From: Tucker Taft @ 1998-09-02  0:00 UTC (permalink / raw)


Bob Fletcher (bob@radge.globalnet.co.uk) wrote:

: Is there a restriction on using descriminants in tagged types in Ada 95? 

One restriction is that you cannot give defaults for the
discriminants, so their value needs to be specified when an
object is created.  Also, when you extend a tagged type, you
must inherit the discriminants, or completely replace them with
a new set.

: ... I
: know it can't be done in the GNAT compiler, it spits out an error, but my
: girlfriend swears blind that the CASE tool they are using on the project
: she's working on has produced a tagged type with a discriminant. I warned
: her that I'm pretty sure this won't work, but maybe it's a compiler issue,
: although I can't imagine it would be.

: Bob Fletcher
: <A HREF="mailto:bob@radge.globalnet.co.uk"></A>

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: discriminants and tagged types
       [not found] <01bdd676$82f6cfa0$f330ea9e@ukp03332>
@ 1998-09-02  0:00 ` Robert I. Eachus
  1998-09-02  0:00 ` Tucker Taft
  1 sibling, 0 replies; 2+ messages in thread
From: Robert I. Eachus @ 1998-09-02  0:00 UTC (permalink / raw)


In article <01bdd676$82f6cfa0$f330ea9e@ukp03332> "Bob Fletcher" <bob@radge.globalnet.co.uk> writes:

 > Is there a restriction on using descriminants in tagged types in Ada 95?

   Yes, you cannot provide defaults for discriminants of a tagged
type. (RM 3.7(11))

 > I know it can't be done in the GNAT compiler, it spits out an error...

   What can't be done?  It could be you are violating 3.7(11) or some
other rule, but I'd have to see the code.
--

					Robert I. Eachus

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-09-02  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <01bdd676$82f6cfa0$f330ea9e@ukp03332>
1998-09-02  0:00 ` discriminants and tagged types Robert I. Eachus
1998-09-02  0:00 ` Tucker Taft

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