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,ab66185f2bca0483 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-15 14:10:21 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.stealth.net!news.stealth.net!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!world!news From: Robert A Duff Subject: Re: Extension of non-limited type needs limited component User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Fri, 15 Nov 2002 22:09:31 GMT Content-Type: text/plain; charset=us-ascii References: <2dbd76f3.0211130203.7d2d14fd@posting.google.com> <2dbd76f3.0211140126.5d233e41@posting.google.com> <3vb7tug4h99mmalcn0l5ul18cu0ui6i458@4ax.com> <6bd9tuc40p68a86rlur3hai1qlv54i8985@4ax.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Organization: The World Public Access UNIX, Brookline, MA Xref: archiver1.google.com comp.lang.ada:30967 Date: 2002-11-15T22:09:31+00:00 List-Id: Dmitry A. Kazakov writes: > In an OO language like Ada 95 is, "limited" makes little sense, > because it covers only one of many useful alternatives. But non-limited/limited does not just mean assignment allowed/disallowed. How do you propose to deal with all the other things controlled by this distinction? For example: Non-limited types can have unconstrained aliased components; limited types cannot. Limited types can have access discriminants; non-limited types cannot. Limited types can have limited components (like tasks and protected objects); non-limited types cannot. The current instance of a limited type is aliased, so you can say "T'Unchecked_Access" inside type T, to make a pointer to the current object of type T. You can't do that for non-limited. (Most) limited types are guaranteed to be passed by reference; that's not true for non-limited. A function can construct a new object of a non-limited type, and return it. You can't do that for (most) limited types. The point is that there are some things you can do for limited that you can't do for non-limited, and vice-versa, so neither is a subset of the other. Therefore, you can't derive a limited type from a non-limited type, nor vice-versa. By the way, have you read the AARM annotations that explain why we didn't allow user-defined ":=" procedures? We certainly wanted to, but we couldn't figure out how to make it work, so we invented Adjust, which is not as powerful. I'd be interested in hearing better ideas (even though it's probably too late). - Bob