comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Class-wide types algebra
Date: Mon, 12 Sep 2016 23:39:27 +0200
Date: 2016-09-12T23:39:27+02:00	[thread overview]
Message-ID: <nr77ah$o16$1@gioia.aioe.org> (raw)
In-Reply-To: f6122bb3-61ac-436e-8ea5-17d84b85c73b@googlegroups.com

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


  reply	other threads:[~2016-09-12 21:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 20:26 Class-wide types algebra Dmitry A. Kazakov
2016-09-12 21:12 ` rieachus
2016-09-12 21:39   ` Dmitry A. Kazakov [this message]
2016-09-13 11:46     ` rieachus
2016-09-13 12:26       ` Dmitry A. Kazakov
2016-09-28  0:05         ` Randy Brukardt
2016-09-28  7:31           ` Dmitry A. Kazakov
2016-09-28 20:17             ` Randy Brukardt
2016-09-29  8:06               ` Dmitry A. Kazakov
2016-09-29 18:44                 ` Randy Brukardt
2016-09-29 19:55                   ` Dmitry A. Kazakov
2016-10-01  5:47                     ` Randy Brukardt
2016-10-01  8:35                       ` Dmitry A. Kazakov
2016-10-05 20:42                         ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox