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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fa18fb47ddd229a7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-10 10:22:45 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Proposed change to BC iterator parameters References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Wed, 10 Dec 2003 18:22:44 GMT NNTP-Posting-Host: 63.184.105.61 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.pas.earthlink.net 1071080564 63.184.105.61 (Wed, 10 Dec 2003 10:22:44 PST) NNTP-Posting-Date: Wed, 10 Dec 2003 10:22:44 PST Xref: archiver1.google.com comp.lang.ada:3322 Date: 2003-12-10T18:22:44+00:00 List-Id: amado.alves wrote: > Strictly you don't need the limited formal for (unlimited) tagged or > class actuals. You need the limited formal for limited actuals, > whatever their class. Limitedness is completely orthogonal to > definiteness. I do like indefinite formals, but I pass well without > limited ones. Most limited formals I've seen in libraries are > accompanied by a formal assignment operation or some such, which > prety much defeats the purpose of their (formal) limitedness, i.e. > their logic is in clash with their definition. The problem is that a generic formal part is a specification; it specifies what the generic needs, and the client must provide, for the generic to do its work. "Limited" implies 2 unrelated concepts: absence of assignment, and absence of predefined equality. To specify that the generic needs to be able to assign objects of a formal type, but does not need to perform equality comparisons, can only be done correctly with a limited private formal type, and a formal Assign procedure. A non-limited formal type specifies that the generic needs to perform equality comparisons on values of the type, which is an error in specification. I know this seems a minor issue to many people, but precise specifications are essential to ensuring the correct usage of reusable components by their clients. This connection between assignment and equality may have made sense in Ada 83, where equality could only be defined for limited types, but seems an unnecessary restriction in Ada 95. In hindsight, it would have been better to eliminate the "limited" reserved word completely, and use instead type T is private; -- Same as Ada's "limited private" type T is private with ":="; -- Assignment defined; "=" not; no Ada equivalent with the capability of defining "=" for either type. -- Jeff Carter "Perfidious English mouse-dropping hoarders." Monty Python & the Holy Grail 10