comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: proposal for new assignment operators
Date: Thu, 3 Jul 2003 00:12:19 -0500
Date: 2003-07-03T00:12:19-05:00	[thread overview]
Message-ID: <vg7enc26438f1d@corp.supernews.com> (raw)
In-Reply-To: Q5NMa.632$i57.44@nwrdny02.gnilink.net

Hyman Rosen wrote in message ...
>I looked at the section on Controlled types (7.4) in the Rationale and
>didn't see any discussion about this, except for a remark about
returning
>limited types from functions. This leads me to believe that the "lot of
>very good reasons" have to do with technical aspects of preserving
>existing parts of Ada rather than abstract notions of how assignment
>should be done properly. Not that there's anything wrong with that.


Sometimes Ada zealots (myself included) overstate the case. We get so
used to explaining something that it starts seeming like a good thing.

The truth is, Adjust was a kludge of sorts that came about for a number
of reasons. It was born of expediency. Ada 9x originally had a
full-blown constructor/destructor/user-defined assignment solution.
However, it is was very complicated, because assignments occur in many
contexts other than assignment statements (and only covering assignment
statements would make it impossible to make a complete abstraction),
because of "disappearing" components (it is not always the case that a
component in the source also exists in the target - which makes proper
composition a nightmare), and because it was orthogonal to everything
else in the language.

When the Distinguished Reviewers decided it was necessary to cut
proposed features (the infamous "scope reduction"), that was one of the
features that was cut.

A few of us (especially me) continued to push for some finalization
solution, because it is a critical capability present in many other
programming languages. Eventually, Tucker and his team proposed a much
lighter-weight solution using tagged types: the Controlled types that we
know and love.

This solution had a variety of nice properties: It didn't need a lot of
special rules (or implementation), because the tagged type rules
eliminated a lot of problems, and the implementation can be the same. It
composes automatically; because the handling of the source and target in
an assignment are separate, disappearing components are not a problem.

But it still is 3/4s of a loaf. That's a lot better than no loaf (which
was the only option politically), but it still isn't an ideal solution.
We have the problem that it cannot be added to an existing type (I
personally don't consider that much of a problem, since there are few
types of any complexity that don't need to be controlled). And there
isn't any way to allow assignments between subtypes with different
discriminants or bounds (since those checks are always performed in the
standard way). Perhaps interfaces will aleviate these problems.

If Ada 95 had been defined from scratch, it probably would not have had
the existing issues that made Finalization/user-defined assignment so
hard. But of course Ada 95 had to be mostly compatible with Ada 83 (as
Ada 2005 will have to be mostly compatible with Ada 95), so we didn't
have the blank sheet of paper to start from.

                       Randy.





  reply	other threads:[~2003-07-03  5:12 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-25  6:23 proposal for new assignment operators Russ
2003-06-25  8:49 ` Preben Randhol
2003-06-25 10:28 ` Dmitry A. Kazakov
2003-06-25 10:36   ` Lutz Donnerhacke
2003-06-25 17:49     ` Dmitry A. Kazakov
2003-06-26 10:37       ` Lutz Donnerhacke
2003-06-27  8:15         ` Dmitry A. Kazakov
2003-06-27 14:21           ` Hyman Rosen
2003-06-25 19:17   ` Russ
2003-06-25 10:39 ` Larry Kilgallen
2003-06-25 12:06   ` Preben Randhol
2003-06-25 13:40     ` Peter Hermann
2003-06-25 22:12     ` Georg Bauhaus
2003-06-26  8:03       ` Preben Randhol
2003-06-26  8:25         ` Vinzent Hoefler
2003-06-26 15:02       ` Stephen Leake
2003-06-26 17:54         ` Georg Bauhaus
2003-06-26 18:32           ` Stephen Leake
2003-06-27 13:21             ` Georg Bauhaus
2003-06-26 16:32       ` Preben Randhol
2003-06-26 17:41         ` Georg Bauhaus
2003-06-26 17:58           ` Preben Randhol
2003-06-26  2:36     ` Steve
2003-06-26  2:33   ` Russ
2003-06-26 23:02     ` John R. Strohm
2003-06-25 14:07 ` Frank J. Lhota
2003-06-25 16:27   ` Warren W. Gay VE3WWG
2003-06-26  3:09     ` Russ
2003-06-26  6:27       ` Vinzent Hoefler
2003-06-26 10:49       ` Larry Kilgallen
2003-06-26 18:08         ` Russ
2003-06-26 18:19           ` Preben Randhol
2003-06-26 18:45           ` Larry Kilgallen
2003-07-02 15:57             ` Kevin Cline
2003-07-02 17:10               ` tmoran
2003-07-02 18:27                 ` Hyman Rosen
2003-07-02 20:20                   ` tmoran
2003-07-03  1:48               ` Richard Riehle
2003-07-03  3:07                 ` Hyman Rosen
2003-07-03  5:12                   ` Randy Brukardt [this message]
2003-07-03 13:03                     ` Hyman Rosen
2003-07-03 14:46                   ` Stephen Leake
2003-07-04  1:17                   ` James Rogers
2003-07-07  4:29                     ` Hyman Rosen
2003-07-08  1:10                       ` James Rogers
2003-07-08 13:59                         ` Hyman Rosen
2003-07-09  0:12                           ` James Rogers
2003-07-09  3:00                             ` Hyman Rosen
2003-07-07 15:36                 ` Matthew Heaney
2003-07-14  1:39                   ` Richard Riehle
2003-07-14  2:54                     ` Hyman Rosen
2003-07-16  3:14                       ` Richard Riehle
2003-06-27 13:34       ` Georg Bauhaus
2003-06-27 23:12         ` Russ
2003-06-27 23:21           ` Larry Kilgallen
2003-06-28 18:51             ` Russ
2003-06-27 18:02       ` Warren W. Gay VE3WWG
2003-06-28  3:50         ` Russ
2003-06-30 15:58           ` Warren W. Gay VE3WWG
2003-06-25 19:44 ` Bill Findlay
2003-06-26  2:06   ` Russ
2003-06-26  2:33     ` Bill Findlay
2003-06-26  5:54     ` Karel Miklav
2003-06-26 12:17     ` Georg Bauhaus
2003-06-26 12:52     ` Joseph Dalton
2003-06-26 18:11     ` Frank J. Lhota
  -- strict thread matches above, loose matches on Subject: below --
2003-06-27  5:35 christoph.grein
2003-06-27  9:57 ` Preben Randhol
2003-06-27 14:11 ` Georg Bauhaus
replies disabled

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