comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Dynamically tagged expression required
Date: Fri, 9 Dec 2005 14:41:30 -0600
Date: 2005-12-09T14:41:30-06:00	[thread overview]
Message-ID: <3LqdnQjDOeBrdwTenZ2dnUVZ_tKdnZ2d@megapath.net> (raw)
In-Reply-To: wccirtygr41.fsf@shell01.TheWorld.com

"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message
news:wccirtygr41.fsf@shell01.TheWorld.com...
...
> If you want to change the Tag of an object, you can't -- you have to use
> access types, and allocate a new object with the new Tag you want.
> In my experience, class-wide types nearly always require use
> of access types and heap allocation.

That's half right. Class-wide types nealry always require the use of access
types somewhere. But you don't necessarily have to use heap allocation; the
objects can be allocated on the stack, and 'Unchecked_Access used to create
the access values.

With proper use of controlled types, this can be completely safe, and much
of the time, it is better than heap allocation for all of the normal
reasons.

For this to work, the access types have to have a fairly controlled usage
(so that it is practical for Finalize to update them); it works best in a
library. Claw works this way, for instance.

                       Randy.






  parent reply	other threads:[~2005-12-09 20:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-08 13:50 Dynamically tagged expression required Maciej Sobczak
2005-12-08 14:46 ` Georg Bauhaus
2005-12-08 14:52 ` Dmitry A. Kazakov
2005-12-08 19:17 ` Martin Krischik
2005-12-09  9:09   ` Maciej Sobczak
2005-12-09 12:05     ` Jean-Pierre Rosen
2005-12-09 16:41     ` Robert A Duff
2005-12-09 20:18       ` Martin Krischik
2005-12-11  0:43         ` Matthew Heaney
2005-12-11 11:45           ` Martin Krischik
2005-12-11 14:24             ` Matthew Heaney
2005-12-11 15:18               ` Martin Krischik
2005-12-11 18:07             ` Matthew Heaney
2005-12-12 19:16               ` Martin Krischik
2005-12-13 20:43                 ` Georg Bauhaus
2005-12-13 21:00                   ` Georg Bauhaus
2005-12-09 20:41       ` Randy Brukardt [this message]
2005-12-09 20:16     ` Martin Krischik
2005-12-11  0:46       ` Matthew Heaney
2005-12-12  9:44       ` Maciej Sobczak
2005-12-12 19:13         ` Martin Krischik
2005-12-14 10:22           ` Maciej Sobczak
2005-12-15 20:10             ` Martin Krischik
replies disabled

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