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,d35129bfe20357c8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-29 14:59:10 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: Re[2]: Limited Type Access - Again Date: Mon, 29 Oct 2001 18:02:10 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:15380 Date: 2001-10-29T18:02:10-05:00 List-Id: wrote in message news:mailman.1004394165.6249.comp.lang.ada@ada.eu.org... > If equality and assignment are allowed in this case, then it is the back door > for comparing and assigning objects of limited type such as task type and > projected type. No. A record type is limited if it has limited components: task type T; type RT is record O : T; end record; O1, O2 : RT; O1 := O2; --will NOT compile if O1 = O2 then --will NOT compile > I think this door should be locked. Already done. This was true already in Ada83. > In addition, comparing or > assignment two objects of a task type does not make sense. It's up to you to decide whether task comparison makes sense. Note that in Ada95 you can compare Task_Id's. > In fact, the language > prohibits two objects of a limited type from being compared or assigned. This is > the reason why equality and assignment of a limited type are prohibited. Not quite -- you don't ever have assignment, but you don't have equality *by default*. Meaning you can provide your own equality operator for a limited type: type RT is limited record ... end record; function "=" (L, R : RT) return Boolean is ... Or even: task type TT; function "=" (L, R: TT) return Boolean is...