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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd40601768eaf8fd X-Google-Attributes: gid103376,public From: Mark Lundquist Subject: Re: Array of Variant Records Question... Date: 1999/09/14 Message-ID: <37DE8D09.C863CBC9@rational.com>#1/1 X-Deja-AN: 525068893 Content-Transfer-Encoding: 7bit References: <7r5vh3$imu1@svlss.lmms.lmco.com> <37d6a45c@news1.prserv.net> <37d6ccb6@news1.prserv.net> <7r77i8$i08$1@nnrp1.deja.com> <37d7c116@news1.prserv.net> <7r8t21$ov5$1@nnrp1.deja.com> <37d822a1@news1.prserv.net> <7reg02$t83@dfw-ixnews6.ix.netcom.com> Organization: Rational Software Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-09-14T00:00:00+00:00 List-Id: Richard D Riehle wrote: > <...> > However, I do like the stronger model for const that C++ provides Me too... (cf. the posts discussing Matt's proposed "access constant" parameters) > and would like to see constant functions in the next version of > Ada. For example, > > constant function (X : access Item) return T: > > or even > > function (X : constant Item) return T; > > where X, in both cases, can be an access to object or access type > for a function and disallows any side-effects on the components of > the parameter. Sorry, I'm not following at all. What are these supposed to mean? Did you leave out the identifier by mistake? Certainly the idea of a C++ -like "const function" is nonsensical for Ada. The meaning and necessity of C++'s const functions are intrisically linked to the idea of "member functions" and distinguished-receiver syntax, which we fortunately don't have in Ada. So you can't mean that... In a sense, "const functions" in C++ are one of the workarounds for class-oriented OO...