From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Legit Warnings or not
Date: Tue, 2 Aug 2011 16:30:24 -0500
Date: 2011-08-02T16:30:24-05:00 [thread overview]
Message-ID: <j19q9s$b7i$1@munin.nbi.dk> (raw)
In-Reply-To: 110nibt4tsn7q.162t6eli286tt.dlg@40tude.net
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:110nibt4tsn7q.162t6eli286tt.dlg@40tude.net...
> On Mon, 1 Aug 2011 17:12:23 -0500, Randy Brukardt wrote:
...
>> > 4. Why a built-in implementation of array of S'Class (what you seemed
>> to be
>>> arguing for) should be easier/more efficient/more compatible to Ada than
>>> an
>>> implementation trough Ada.Container only publicly visible as an array?
>>
>> There is no new magic needed to allow S'Class as a component type -- only
>> the removal of a single legality rule (much like Ada 2005 eliminated the
>> library-level requirement on derived tagged types).
>
> That is because your compiler already implements this magic. Other
> compilers may have problems with that.
True enough, but that surely was true for removing the library-level
requirement -- no compiler had that magic. My point was that such a change
does not change the model of the language at all -- the only cost
(admittedly, not trivial) would be for implementations.
> And for a programmer the problem is to have control over the constraints
> (when the tag can be changed and when not) and over copying (when dynamic
> components get copied, when shared). You will need a lot of new keywords
> and syntax constructs to specify all possible and needed combinations of
> these, plus terrible rules about how these constraints are propagated upon
> composition and inheritance. What happens in generics etc.
That's taking a simple change and making it far more complex. I'm suggesting
changing 3.6(10) [only] to allow S'Class. Nothing further, and this isn't
making any attempt to allow more of anything else.
Indeed, allowing this would have to be tied to eliminating the bogus
possibility of having partially constrained S'Class subtypes. (The vast
majority of compilers don't support this possibility, even though the
language insists on it). Thus there are no constraints to "have control
over". Either you are allowing changing the object to anything in the class,
or you are not allowing it to be changed at all. No middle ground there.
And there is no "control over copying". These are normal "parts" of the
object, and they're always copied. If you don't want copying, then you need
to use some sort of reference (cursor or access type). (Of course, an
implementation can always do an "as-if" implementation, but the model is
always deep copying.)
There is no need or value to trying to go beyond that. "Shallow copying" is
nasty; pretty much the only value is for performance reasons and it is best
to leave those to the compiler. (Premature optimization and all of that.)
> To me it is just an overkill. Ada already suffers a plethora of
> unorganized
> special cases of types instead of a clean and *small* type system.
This would *eliminate* some of the special cases (allowing more types
unfettered as components and objects). Ada is at the point in its life where
only incremental changes can happen -- so redoing the Ada type system isn't
happening.
Randy.
next prev parent reply other threads:[~2011-08-02 21:30 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-20 22:30 Legit Warnings or not Anh Vo
2011-07-20 23:16 ` Robert A Duff
2011-07-21 18:43 ` Anh Vo
2011-07-23 0:26 ` Randy Brukardt
2011-07-23 14:26 ` Robert A Duff
2011-07-21 2:37 ` Jeffrey Carter
2011-07-21 9:50 ` Brian Drummond
2011-07-21 14:39 ` Dmitry A. Kazakov
2011-07-23 0:36 ` Randy Brukardt
2011-07-23 9:03 ` Dmitry A. Kazakov
2011-07-23 11:07 ` Simon Wright
2011-07-23 11:21 ` Dmitry A. Kazakov
2011-07-26 21:25 ` Randy Brukardt
2011-07-27 7:45 ` Dmitry A. Kazakov
2011-07-28 0:37 ` Randy Brukardt
2011-07-28 9:22 ` Dmitry A. Kazakov
2011-07-28 14:22 ` Robert A Duff
2011-07-28 14:41 ` Dmitry A. Kazakov
2011-07-28 15:10 ` Robert A Duff
2011-07-28 17:05 ` Dmitry A. Kazakov
2011-07-28 23:32 ` Randy Brukardt
2011-07-28 23:48 ` Randy Brukardt
2011-07-29 6:57 ` Simon Wright
2011-07-29 18:56 ` Jeffrey Carter
2011-07-30 0:13 ` Randy Brukardt
2011-07-29 7:41 ` Dmitry A. Kazakov
2011-07-30 0:17 ` Randy Brukardt
2011-07-30 8:27 ` Dmitry A. Kazakov
2011-08-01 22:12 ` Randy Brukardt
2011-08-02 10:01 ` Dmitry A. Kazakov
2011-08-02 21:30 ` Randy Brukardt [this message]
2011-08-03 9:01 ` Dmitry A. Kazakov
2011-08-03 20:35 ` Randy Brukardt
2011-08-04 8:11 ` Dmitry A. Kazakov
2011-08-05 23:57 ` Randy Brukardt
2011-08-06 8:23 ` Dmitry A. Kazakov
2011-08-08 21:30 ` Randy Brukardt
2011-07-23 14:32 ` Robert A Duff
2011-07-26 21:32 ` Randy Brukardt
2011-07-21 15:28 ` Adam Beneschan
2011-07-21 15:41 ` Robert A Duff
2011-07-21 20:12 ` Adam Beneschan
2011-07-23 0:31 ` Randy Brukardt
2011-07-21 17:40 ` Jeffrey Carter
2011-07-21 21:30 ` Brian Drummond
2011-07-21 21:54 ` Adam Beneschan
2011-07-22 10:16 ` Brian Drummond
2011-07-22 14:54 ` Adam Beneschan
2011-07-23 0:46 ` Randy Brukardt
2011-07-23 0:42 ` Randy Brukardt
2011-07-23 9:20 ` Niklas Holsti
2011-08-04 5:56 ` David Thompson
2011-07-23 9:24 ` Dmitry A. Kazakov
2011-07-23 12:36 ` Brian Drummond
2011-07-21 15:13 ` Robert A Duff
2011-07-23 0:52 ` Randy Brukardt
2011-07-23 14:48 ` Robert A Duff
2011-07-21 14:17 ` anon
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox