From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Run-time accessibility checks (was: Construction initialization problem)
Date: Wed, 10 Dec 2008 18:55:41 -0600
Date: 2008-12-10T18:55:41-06:00 [thread overview]
Message-ID: <ghpoep$i61$1@munin.nbi.dk> (raw)
In-Reply-To: txbc0ucekvix.ntpy85qsan7h$.dlg@40tude.net
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:txbc0ucekvix.ntpy85qsan7h$.dlg@40tude.net...
> On Fri, 5 Dec 2008 19:42:40 -0600, Randy Brukardt wrote:
...
>> I think that I might be able to fix the problem in the context of the
>> containers only, and for dereference of the objects only, but it is not
>> clear that the fix is worth the effort.
>
> It certainly does not. IMO Ada needs "setters" with the syntax sugar of an
> assignment, it does not need outward access types. The whole idea is just
> not Ada.
Well, I've thought about that, but I don't see a decent way to describe
read/write semantics other than with an access type. Specifically, I was
trying to figure out a user-defined dereference operation. One would presume
that we would use an operator function for that, but what would it look
like? The obvious answer of:
function "all" (Obj : in Some_Type) return access Some_Other_Type;
has the accessibility issues. And something like:
function "all" (Obj : in Some_Type) return Some_Other_Type;
means that you have (usually) copy semantics and in any case no assignment
into. That doesn't really fix anything.
You certainly can't have a procedure ":=" to do assignment in because of
discrimant-dependent components. That's never going to change for Ada, so
please forget that.
I suppose you could have a component setter, but that requires a procedure
with two names:
procedure <component>.":=" (Target : in out Some_Tagged_Type; Source :
in Some_Other_Type);
which would then be used as:
Target.<component> := Source;
But that looks like a giant change to the Ada models, almost certainly out
of scope for this current round. And it certainly means no useful iterators.
And it also isn't very flexible -- where does the Cursor of a container go??
And so on.
Randy.
next prev parent reply other threads:[~2008-12-11 0:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-06 10:15 Run-time accessibility checks (was: Construction initialization problem) Dmitry A. Kazakov
2008-12-06 17:10 ` Ludovic Brenta
2008-12-07 8:44 ` Run-time accessibility checks Dmitry A. Kazakov
2008-12-07 14:56 ` Ludovic Brenta
2008-12-07 19:22 ` Dmitry A. Kazakov
2008-12-11 1:03 ` Randy Brukardt
2008-12-11 9:08 ` Dmitry A. Kazakov
2008-12-11 0:55 ` Randy Brukardt [this message]
2008-12-11 9:48 ` Dmitry A. Kazakov
2008-12-11 11:21 ` Georg Bauhaus
2008-12-11 11:40 ` Dmitry A. Kazakov
2008-12-11 22:15 ` Run-time accessibility checks (was: Construction initialization problem) Randy Brukardt
2008-12-11 22:31 ` Randy Brukardt
2008-12-13 0:49 ` Randy Brukardt
2008-12-13 9:06 ` Run-time accessibility checks Dmitry A. Kazakov
2008-12-16 1:53 ` Randy Brukardt
2008-12-16 9:28 ` Dmitry A. Kazakov
2008-12-16 22:21 ` Randy Brukardt
2008-12-17 8:54 ` Dmitry A. Kazakov
2008-12-12 9:21 ` 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