comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Tagged type abuse
Date: Fri, 19 Dec 2014 18:07:30 -0600
Date: 2014-12-19T18:07:30-06:00	[thread overview]
Message-ID: <m72ek2$nnj$1@loke.gir.dk> (raw)
In-Reply-To: m716fq$91n$1@speranza.aioe.org

"Michael B." <michaelb@example.com> wrote in message 
news:m716fq$91n$1@speranza.aioe.org...
> Am 19.12.2014 um 00:10 schrieb Randy Brukardt:
>> Note that in pre-2012 Ada, you needed to use tagged types get "=" to work
>> right vis-a-vis composition. (Ada 2012 extended that to all record types,
>> which of course means that some programs that expect the wrong answer 
>> will
>> break. But in most cases, the change will fix bugs rather than create 
>> them.)
>
> Could you be more specific on that?

The case in question is the operator used in a composed "=". That is, what 
operator is used to compare components of a type in some non-limited 
composite type.

In Ada 83-2005, untagged record types compose using a reimergence of 
predefined "=" (the user-defined "=" is ignored in that case). That was not 
changed in Ada 95 because of compatibility concerns. But the problem wasn't 
going away, and having an aspect to do the right thing made no sense and 
having an aspect to do the wrong thing helps no-one (the code would have to 
be modified, but if you can do that, you might as well fix it). So we just 
changed it. We think that 99% of the time, people would rather have the 
user-defined "=" used (why else would you have defined it?)

                                Randy.


  reply	other threads:[~2014-12-20  0:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18 11:26 Tagged type abuse Natasha Kerensikova
2014-12-18 13:01 ` Dmitry A. Kazakov
2014-12-18 16:59 ` Jeffrey Carter
2014-12-18 23:10   ` Randy Brukardt
2014-12-19 12:42     ` Michael B.
2014-12-20  0:07       ` Randy Brukardt [this message]
2014-12-20 12:39         ` Michael B.
replies disabled

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