comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Overring function and its returned type
Date: Fri, 9 Nov 2012 14:11:38 +0100
Date: 2012-11-09T14:11:38+01:00	[thread overview]
Message-ID: <16xl96g780qw8.1nc3x394b8m68.dlg@40tude.net> (raw)
In-Reply-To: op.wnh1aik1ule2fv@cardamome

On Fri, 09 Nov 2012 10:14:32 +0100, Yannick Duch�ne (Hibou57) wrote:

> Le Fri, 09 Nov 2012 09:24:18 +0100, Dmitry A. Kazakov  
> <mailbox@dmitry-kazakov.de> a �crit:
> 
>> On Fri, 09 Nov 2012 08:13:23 +0100, Yannick Duch�ne (Hibou57) wrote:
>>
>>>            overriding
>>>            function F
>>>              (E : T)
>>>               return R'Class -- Not overriding :-(
>>>               is abstract;
>>
>> What is this? "overriding" + "abstract" does not make sense.
> 
> Overriding sometime do nothing, just remind something, recall an inherited  
> definition explicitly.

No, overriding *always* does something. It overrides the part of the
polymorphic body it specifies.

------------
Alas, I overlooked that you used "R" for two different types. Yet another
argument for consequent use of "use" clauses! Down with "with" (:-))

I don't see a good reason why nominal type equivalence should be further
eroded. When you derive a new interface you get another type. It may have
operations of its own. So, it is not automatically compatible.

A more general question is about overriding out-operations to narrower
subtypes, and/or overriding in-operations to wider subtypes. That could
work.

Specifically regarding class-wide types they are not considered subtypes. I
believe there could be too many conflicts to make them subtypes. I mean a
model in which when S is derived from T, then S'Class is a subtype of
T'Class (constrained to S and its descendants).

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-11-16  9:16 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09  7:13 Overring function and its returned type Yannick Duchêne (Hibou57)
2012-11-09  7:22 ` Yannick Duchêne (Hibou57)
2012-11-09  8:24 ` Dmitry A. Kazakov
2012-11-09  9:14   ` Yannick Duchêne (Hibou57)
2012-11-09 13:11     ` Dmitry A. Kazakov [this message]
2012-11-09 21:36       ` Yannick Duchêne (Hibou57)
2012-11-09 19:24   ` Adam Beneschan
2012-11-09 19:34 ` Adam Beneschan
2012-11-09 22:00   ` J-P. Rosen
2012-11-09 22:30     ` Yannick Duchêne (Hibou57)
2012-11-09 19:57 ` sbelmont700
2012-11-09 21:10   ` Yannick Duchêne (Hibou57)
2012-11-09 21:56     ` sbelmont700
2012-11-10  0:28     ` Yannick Duchêne (Hibou57)
2012-11-10  2:35       ` Yannick Duchêne (Hibou57)
2012-11-15 15:13   ` Peter C. Chapin
2012-11-16 10:40     ` Maciej Sobczak
2012-11-16 12:39       ` Peter C. Chapin
2012-11-16 15:27         ` Maciej Sobczak
2012-11-16 17:29           ` Peter C. Chapin
2012-11-17  4:16           ` Yannick Duchêne (Hibou57)
2012-11-17 19:11             ` Robert A Duff
2012-11-18 14:53               ` AdaMagica
2012-11-19  8:41                 ` Yannick Duchêne (Hibou57)
2012-11-19 13:04                   ` AdaMagica
2012-11-19 15:19                     ` Dmitry A. Kazakov
2012-11-19 23:42                   ` Randy Brukardt
2012-11-10  7:55 ` Randy Brukardt
2012-11-11  1:02   ` Yannick Duchêne (Hibou57)
replies disabled

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