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-Thread: 103376,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!01cc3b7c!not-for-mail Reply-To: "Richard Riehle" From: "Richard Riehle" Newsgroups: comp.lang.ada References: <49dc98cf.0408110556.18ae7df@posting.google.com> <1w3sfkwcp4q0e.1u4xeln7msgi5$.dlg@40tude.net> Subject: Re: ADA Popularity Discussion Request X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Message-ID: Date: Mon, 23 Aug 2004 22:20:59 GMT NNTP-Posting-Host: 66.81.217.252 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1093299659 66.81.217.252 (Mon, 23 Aug 2004 15:20:59 PDT) NNTP-Posting-Date: Mon, 23 Aug 2004 15:20:59 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:2943 Date: 2004-08-23T22:20:59+00:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1w3sfkwcp4q0e.1u4xeln7msgi5$.dlg@40tude.net... > Regarding limited types: > Whether it was a fundamental flaws is a question, but not everybody is > happy with limited types. They are a mixture of quite different concepts > which probably should be dealt separately: > > 1. No assignment, never > 2. No predefined [in]equality > 3. Cannot be initialized (who need such? Ada 2005 will probably fix that) > 4. Cannot be copied (no copy constructor) > 5. Passed by reference > Of your criticisms, only number 3 is an occasional, but not insurmountable nuisance. I take 1 and 4 together. Assignment and copy are identical in many respects. When I design with limited types, I nearly always include a "copy" procedure in my design. Someties I include a "Move." And sometimes I include a more specific "copy" one that tells the client of my package specifically what to expect in calling the copy procedure. As to point number 3. For composite types, especially record types, I don't want predefined equality. This is one of the most important ideas in limited types. Instead, I design functions that test for equality that do not use the "=" operator. For example, function Key_is_Equal (L, R : limited_type) return Boolean; function Data_Is_Equal (L, R : limited_type) return Boolean; When someone calls one of these functions, they know exactly what they are getting. It may not be as convenient as the "=", but no one every complains about being surprised by the result. > 4 => 5, but why 5 should imply 4? 2 is unrelated to anything else. 1 should > be no different from 2 or any other *operation*. 3 is nonsense. > Richard Riehle