From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d2f0af5e440b367f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-02 18:46:08 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newshub.sdsu.edu!elnk-pas-nf2!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: proposal for new assignment operators Date: Wed, 02 Jul 2003 18:48:39 -0700 Organization: AdaWorks Software Engineering Message-ID: <3F038B77.2F2E41B7@adaworks.com> References: <3EF9CD5F.6030608@cogeco.ca> <3doRhIgUmUYX@eisner.encompasserve.org> Reply-To: richard@adaworks.com NNTP-Posting-Host: 41.b2.61.70 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 3 Jul 2003 01:46:06 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:39999 Date: 2003-07-03T01:46:06+00:00 List-Id: Kevin Cline wrote: > I found the distinction between controlled and uncontrolled types to > be completely obscure and to my mind completely unnecessary, > particularly when compared with C++, where one simply overrides the > assignment operator if desired. One reason for the peculiarity is that Ada, unlike C++, has limited types. For limited types, assignment is never possible. Therefore, overloading assignment is not possible. Limited types are used for most container classes. It is rare that one even needs to override the assignment operator on a non-limited type. There is a distinction here that will not be immediately obvious to the C++ programmer. Additionally, the idea of Adjust for overriding assignment was done intentionally after much wrangling about whether the language should allow direct overriding or overloading the assignment operation. For a lot of very good reasons, the designers eschewed the C++ approach in favor of the Adjust approach. These reasons are discussed in some of the literature that covers the rationale for the language design. Richard Riehle