From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5cd2177597e1920b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.germany.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed101.telia.com!nf02.dk.telia.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: discriminants, what are they? Date: Sun, 17 Dec 2006 19:33:27 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1166399856.146825.149540@f1g2000cwa.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1166402007 32503 192.74.137.71 (18 Dec 2006 00:33:27 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 18 Dec 2006 00:33:27 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:LFzZmFL124cQGeGxpZwP3NnAoKU= Xref: g2news2.google.com comp.lang.ada:7937 Date: 2006-12-17T19:33:27-05:00 List-Id: "markww" 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