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: Proposed Ada features (was Re: Array of Variant Records Question...) Date: 1999/09/10 Message-ID: <37D955B5.A018835D@rational.com>#1/1 X-Deja-AN: 523498271 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> Organization: Rational Software Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-09-10T00:00:00+00:00 List-Id: Robert Dewar wrote: > In article <37d7c116@news1.prserv.net>, > "Matthew Heaney" wrote: > > 1) access constant params Yes. And Matt, don't forget "is limited access"... As I recall you were the one who mentioned this a while back, but for some reason it didn't make your wish list (or, it's far enough behind "winning the lottery" not to merit mention :-) I have had exactly the same wish (for limited access types, not the lottery :-) and it came up in exactly the same context: I was implementing a generic mixin for reference-counted memory-managed objects, and the non-limitedness of the access type breaks reference safety. On the other hand, the unsafe access type would be useful for local assignments (e.g. a swap) where you know that a "lightweight" (uncounted) assignment will do. So I'm equivocating a little. I couldn't think of a workaround that would ensure that you are using the unsafe mechansim in a way that is in fact safe. > > > > > > 2) the ability to cast away const w/o using > Sys.Addr_To_Acc_Convs > > Sorry, no idea what this means ...from the speech of barbarians, there is no translation in our tongue... :-) :-) :-) :-) Here's my understanding of it. I'm not at all sure that it's accurate, maybe someone can help me out... In C++, 'const' is more like an attribute of the type than of the object. Given an object of a 'const type' (typically a function parameter), you can render that object assignable by means of a cast (conversion) to a 'non-const type'. In C you would use the "(type)" syntax, and in C++ you would use the built-in template function const_cast(). This formula is known as "casting away const" (because you are not really changing the type per se, just the "constness"). What I haven't figured out is why you would want to do this. Same with "mutable". > > 6) the ability to invoke a constructor/initializer for limited > types in the > > declarative region > > sorry, I do not know what you mean here, and I certainly > do not know what a constructor is, example would be useful. I think in Ada, it would just be a function call as an initialization expression. The idea is to allow this for limited types.