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-30 09:10:36 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news1.sttln1.wa.home.com.POSTED!not-for-mail From: "Mark Lundquist" Newsgroups: comp.lang.ada References: Subject: Re: Re[2]: Limited Type Access - Again X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: Date: Tue, 30 Oct 2001 17:10:36 GMT NNTP-Posting-Host: 24.248.56.237 X-Complaints-To: abuse@home.net X-Trace: news1.sttln1.wa.home.com 1004461836 24.248.56.237 (Tue, 30 Oct 2001 09:10:36 PST) NNTP-Posting-Date: Tue, 30 Oct 2001 09:10:36 PST Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:15423 Date: 2001-10-30T17:10:36+00: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, it's not a back door! There's no assignment for limited types. In fact, that's the definition of "limited type" -- a type for which there is no assignment. How about this... supply a minimal complete example of how you think this can happen due to an access-to-limited type being itself non-limited, with a comment saying "HERE IS WHERE IT HAPPENS" at the relevant line, then we can walk through it and show you that it's really not happening (or more likely, you'll see it yourself when you try this exercise :-) > I think this door should be locked. In addition, comparing or > assignment two objects of a task type does not make sense. Assignment certainly doesn't, which is why tasks are limited. But there's no "back door". > 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. True for assignment (by definition)... but "=" is not *prohibited*... there just is not any *predefined* "=" for limited types. You can define it yourself. If you have a component of a record that is an access to a limited type (as in your earlier examples), and you don't want someone to be able to assign or compare it (realizing of course that being able to assign/compare the access object is not a back door to being able to have your way with the denoted object), then maybe you can do something like this: type Foo_Handle is limited private; type Wumpus is record Something : Whatever; . . . Foo : Foo_Handle; end Record; private type Foo; type Foo_Handle is access Foo; Note that: 1) type Wumpus is limited, because it has a limited component 2) This example does not depend on the full type of Foo being limited, although it very well could be (e.g. it could be your protected type). 3) In this example the full type definition is deferred to the body, but the example does not depend on this. You could include the full type in the private part (or even the public part) if you had a good reason, and Foo_Handle and Wumpus would still be limited. 4) But don't go to this trouble because you think it closes a "back door" to assigning to a limited type, because there is no such back door. Hope this helps, -- mark