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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Class-wide types algebra Date: Mon, 12 Sep 2016 23:39:27 +0200 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: 4UnmtEBiFcCZzQad+30FUw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:31759 Date: 2016-09-12T23:39:27+02:00 List-Id: On 2016-09-12 23:12, rieachus@comcast.net wrote: > On Monday, September 12, 2016 at 4:26:24 PM UTC-4, Dmitry A. Kazakov wrote: >> Presently class-wide types are singletons. I would propose to extend >> that to call-wide expressions, namely conjunction in all places where >> T'Class is expected. e.g. >> > A more > restricted case, which should deal with the issue would be to allow > "T'Class is in R'Class;" where R is an interface, or an ancestor of T'Class. I am not sure what you mean. Ada's "in" has the mathematical meaning "member of" (∈). If you meant "subset of"/"subsumption" (⊆) then it is just same as T in R'Class It is already there. It would be nice to have comparisons like: T'Class <= R'Class <=> T in R'Class But that is not the problem. > Why the second case? The real issue seems to be visibility. You have > an interface, and a type which could/should be a member, but the > declaration is more deeply nested. (There would still need to be some > magic so that the lifetime of T'Class is the same as R'Class. Or better, > just a rule that requires them to have the same lifetime from other rules.) I don't see any problems with that. All types in question are statically known. Type tests are expressible already X in (T'Class and R'Class) <=> (X in T'Class) and (X in R'Class) The real problem is declarations not tests. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de