comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: discriminants, what are they?
Date: Sun, 17 Dec 2006 19:33:27 -0500
Date: 2006-12-17T19:33:27-05:00	[thread overview]
Message-ID: <wccy7p69h60.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 1166399856.146825.149540@f1g2000cwa.googlegroups.com

"markww" <markww@gmail.com> writes:

> Hi,
>
> Can explain what an Ada discriminant is? I found this definition but

It's a parameter that can be passed to a type when making an object of
the type, sort of like a parameter passed to a procedure when making a
call to that procedure.  It can be used inside the type to determine which
variant you want, or the bounds of an array, or to pass further along to
another discriminant of a component type, or in an expression that
initializes a component.

Another view: it's a constant component.  Once you give a discriminant
of a particular object a value, that value cannot change.

> I'm new to Ada so I can't quite understand the technical definition.
> 
> http://www.grammatech.com/rm95html-1.0/rm9x-03-07.html

Indeed, this technical definition is rather arcane.  You should look at
a textbook or tutorial that gives examples.

That's not even the latest version of the Ada RM, by the way...

- Bob



  reply	other threads:[~2006-12-18  0:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-17 23:57 discriminants, what are they? markww
2006-12-18  0:33 ` Robert A Duff [this message]
2006-12-18  0:43   ` markww
2006-12-18 10:23   ` Dmitry A. Kazakov
2006-12-18  9:35 ` gautier_niouzes
replies disabled

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