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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a5d:8509:: with SMTP id q9mr1831184ion.1.1547695228768; Wed, 16 Jan 2019 19:20:28 -0800 (PST) X-Received: by 2002:a9d:709a:: with SMTP id l26mr202938otj.1.1547695228605; Wed, 16 Jan 2019 19:20:28 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.166.216.MISMATCH!q69no987itb.0!news-out.google.com!v71ni20ita.0!nntp.google.com!q69no985itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 16 Jan 2019 19:20:27 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=70.109.61.2; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 70.109.61.2 References: <167dc83d-daac-49eb-ba79-48866ccde39d@googlegroups.com> <0c56d9f4-8861-4c74-b170-a973e3789b08@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <252afc47-fe7d-41bc-b394-0735e1fd2e4c@googlegroups.com> Subject: Re: Overloading operator "=" for anonymous access types? From: Jere Injection-Date: Thu, 17 Jan 2019 03:20:28 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:55289 Date: 2019-01-16T19:20:27-08:00 List-Id: On Monday, January 14, 2019 at 6:08:36 PM UTC-5, Randy Brukardt wrote: > As always, best avoid anonymous access types unless you have to use one of > their special features (dynamic accessibility, dispatching, special > discriminant accessibility, or closures [for access-to-subprograms]). And > better still, lets lobby to get those special features optionally available > for named access types so no one every has to use an anonymous anything. :-) > > Randy. I mostly find myself using them in situations where I need to save an access variable of an object that doesn't live as long as the access type involved. I can't do that safely with named access types. For example, using them in containers (need the access type for iterators, cursors, etc.) but creating those container objects inside an operation of some form. I feel like having to use Unchecked_Access somewhat defeats the purpose of using Ada (not all of it, just some). Are there any plans to add smarter and more relaxed named access types in the future? Something akin to rust references (especially with the recently released non lexical lifetimes update)? It's definitely possible to track references in such a way though I wouldn't claim it was easy to do.