comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: Re: Overloading operator "=" for anonymous access types?
Date: Wed, 16 Jan 2019 19:20:27 -0800 (PST)
Date: 2019-01-16T19:20:27-08:00	[thread overview]
Message-ID: <252afc47-fe7d-41bc-b394-0735e1fd2e4c@googlegroups.com> (raw)
In-Reply-To: <q1j4pi$2h0$1@franka.jacob-sparre.dk>

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.

  parent reply	other threads:[~2019-01-17  3:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11 21:46 Overloading operator “=” for anonymous access types? daicrkk
2019-01-12  9:50 ` Simon Wright
2019-01-12 14:01   ` Simon Wright
2019-01-12 15:15   ` daicrkk
2019-01-14 23:08     ` Overloading operator "=" " Randy Brukardt
2019-01-15  0:34       ` Shark8
2019-01-15  8:38       ` Dmitry A. Kazakov
2019-01-15 21:00         ` Randy Brukardt
2019-01-16 15:42           ` Dmitry A. Kazakov
2019-01-15  8:51       ` daicrkk
2019-01-15 11:15         ` Simon Wright
2019-01-17  3:20       ` Jere [this message]
2019-01-17  8:23         ` Dmitry A. Kazakov
2019-01-17 22:22         ` Randy Brukardt
2019-01-18 10:17           ` Dmitry A. Kazakov
2019-01-18 13:27           ` Jere
2019-01-18 13:42             ` Dmitry A. Kazakov
replies disabled

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