comp.lang.ada
 help / color / mirror / Atom feed
From: Vincent Marciante <marciant@li.net>
Subject: Re: Redefined "=" = generic disaster?
Date: Tue, 31 Oct 2000 01:54:07 -0500
Date: 2000-10-31T01:54:07-05:00	[thread overview]
Message-ID: <39FE6C8F.4EE9@li.net> (raw)
In-Reply-To: 39FE3C35.64CBB3C7@ix.netcom.com

>Lao Xiao Hai wrote:
> 
> As I recall, the discussion had something to do with unreliable
> expectations with regard to overloading the equality operator.

The (wrong) expectation that I was presenting, was that of 
expecting the redefined "=" to be the "=" that would be used
in a generic that imported a private type _and_utilized_ the 
implicitely imported "=".  

The point was not that a screwy "=" could be defined for a private
type in Ada 95 - but that an Ada 83 generic could depend on the
fact that it would be getting the "=" that an instantiator expected
it to get. (If predefined "=" did not produce the approriate results
for his ADT then the designer of the type being used in the 
instantiation would have taken it away by making the type limitted
private and as a result, that type would not have been able to have
been used as the actual type in the instantiation.)  Now in Ada 95,
someone might think "hey! instead of making my ADT (whose predefined
"=" does not exhibit the desired semantics) be limitted private I can
simply override "=" and then be able to use my ADT in instances of
that old Ada 83 generic code that imports a private type.  Kewl!"

But we know that his instance will not work as he expects; yes, the
instantiation will compile but the (he thinks) overriding "=" that he
define is not used in the instance, predefined "=" is!



  reply	other threads:[~2000-10-31  6:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-21  6:59 Redefined "=" = generic disaster? Vincent Marciante
2000-10-21  0:00 ` Jeff Carter
2000-10-21  0:00   ` Vincent Marciante
2000-10-28 11:12     ` Robert Dewar
2000-10-29  8:43       ` Vincent Marciante
2000-10-30  3:49       ` Lao Xiao Hai
2000-10-30 18:46         ` Robert Dewar
2000-10-31  3:27           ` Lao Xiao Hai
2000-10-31  6:54             ` Vincent Marciante [this message]
2000-10-31 19:51             ` Robert Dewar
2000-11-01 17:47               ` Mats Weber
2000-11-02  5:27                 ` Vincent Marciante
2000-11-02 16:52                   ` Mats Weber
2000-11-02 14:59                 ` Tucker Taft
2000-11-05  4:29                   ` Robert Dewar
2000-11-05  4:32                   ` Robert Dewar
2000-11-05  4:26                 ` Robert Dewar
2000-10-21  0:00   ` Vincent Marciante
2000-10-22  2:50     ` Jeff Carter
2000-10-22  0:00       ` Vincent Marciante
replies disabled

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