comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: Extending discriminant types
Date: Fri, 21 Nov 2008 07:25:27 GMT
Date: 2008-11-21T07:25:27+00:00	[thread overview]
Message-ID: <HntVk.145785$Mh5.112813@bgtnsc04-news.ops.worldnet.att.net> (raw)
In-Reply-To: 3f77e490-2f54-4441-828e-6c6e68d245df@a17g2000prm.googlegroups.com

Adam,

Try an explain this. Since I downloaded my binary version of GNAT-3.15p 
direct from Adacore. And someone else has said the GNAT-3.15p is old but 
it has been fully tested and found to be correct. So, that means that time 
Adacore agreed that "Base" attribute could be used outside of scalars and 
that was years after the RM and AARM for Ada 95 was written.


Now, both in the AARM 95 and AARM 2005. contains a section 3.2.3 (8.a) 
beside yoyur (63.a):

quote
                        Incompatibilities With Ada 83

    8.a   {incompatibilities with Ada 83} The attribute S'Base is no longer
          defined for non-scalar subtypes. Since this was only permitted as
          the prefix of another attribute, and there are no interesting
          non-scalar attributes defined for an unconstrained composite or
          access subtype, this should not affect any existing programs.
unquote

First, there is a  "interesting non-scalar attributes defined for an 
unconstrained composite or access subtype", it used in "Object-oriented
programming" (OOP). But back in 90s, Ada was a late starter for OOP and 
even with the Ada 2005 OOP extensions some might still say its late to 
the plate or should that be table. 

Secondly, there is another side to 3.2.3 (8.a) and others listed in the 
AARM, and that is the clarifying statement "incompatibilities with Ada 
83". But that does not say that "X'Base" or "T'Base" can not exist. If 
that was the case, a form of this statement would also be listed in 
"Annex J: Obsolescent Features" of the official RM.

   In my example the syntax for "Base" attribute would be more like:

        T'Base  T'Base denotes an unconstrained subtype of the 
                type of T also called the base subtype of the 
                type T.

and not "S'Base".



In <3f77e490-2f54-4441-828e-6c6e68d245df@a17g2000prm.googlegroups.com>, Adam Beneschan <adam@irvine.com> writes:
>On Nov 20, 2:59 pm, a...@anon.org (anon) wrote:
>> First, the second specification package that I use was written by
>> "Pascal Leroy". another editor of the Ada 2005 RM. "Randy Brukardt"
>> skip this topic.
>>
>> QUOTE
>> Our compiler currently rejects the following code fragment because it
>> complains that the overriding "=" is not subtype conformant with the
>> inherited "=" (3.9.2(10)):
>>
>>        package P is
>>                 type T is tagged private;
>>                 function "=" (Left, Right : T'Base) return Boolean;
>>         private
>>                 type T is tagged null record;
>>         end P;
>>
>> T is a constrained subtype as per 3.2(9), so as far as I understand, T is
>> different from the "T italic" used in 4.5.2(7).
>>
>> I hope that there is flaw in my reasoning, because if it is correct, it
>> looks like we have a pretty severe problem...
>>
>> Pascal
>> UNQUOTE
>>
>> And since both RM 95 and RM 2005, do not clarify that the "Base" attribute
>> is for scalar types only, then you must assume that the "Base' attribute
>> can apply to other types as well.
>
>The Annotated Ada Reference Manual does clarify this, though.  See
>AARM 3.5(63.a).  http://www.adaic.org/standards/05aarm/html/AA-3-5.html
>
>
> Else either "Pascal Leroy" or may be
>> "Randy Brukardt" would have correct the misunderstanding of this
>> attribute, especially since, Pascal implied the understanding in the
>> first place by use of his example.
>
>Either that, or both Pascal and Randy are human and both erred by
>missing the problem.  It happens.
>
>                                -- Adam




  reply	other threads:[~2008-11-21  7:25 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-15  9:16 Extending discriminant types Stefan Bellon
2008-11-15 18:50 ` Jeffrey R. Carter
2008-11-17 16:30 ` Adam Beneschan
2008-11-18 11:02   ` christoph.grein
2008-11-18 23:24     ` Adam Beneschan
2008-11-19  9:49 ` anon
2008-11-19 10:15   ` christoph.grein
2008-11-19 19:19     ` Georg Bauhaus
2008-11-19 11:38   ` Martin
2008-11-20  7:21   ` anon
2008-11-20  8:30     ` christoph.grein
2008-11-20  8:36       ` Ludovic Brenta
2008-11-20 11:45         ` Georg Bauhaus
2008-11-20 11:46           ` Georg Bauhaus
2008-11-20 23:01             ` anon
2008-11-21 11:54               ` Ludovic Brenta
2008-11-20 14:03           ` Dmitry A. Kazakov
2008-11-20 15:03           ` Robert A Duff
2008-11-20 15:57             ` Stefan Bellon
2008-11-21  0:32               ` Adam Beneschan
2008-11-20 16:11           ` Adam Beneschan
2008-11-20 22:59       ` anon
2008-11-21  0:29         ` Adam Beneschan
2008-11-21  7:25           ` anon [this message]
2008-11-21  9:19             ` Jean-Pierre Rosen
2008-11-21 10:11             ` christoph.grein
2008-11-21 12:00             ` Ludovic Brenta
2008-11-21 22:31               ` anon
2008-11-22  0:18                 ` Stefan Bellon
2008-11-23  4:06                   ` anon
2008-11-23  5:39                     ` Georg Bauhaus
2008-11-23  8:00                       ` anon
2008-11-24 10:08                         ` Georg Bauhaus
2008-11-24 22:16                           ` anon
2008-11-25 10:37                             ` Martin
2008-11-25 11:24                               ` Georg Bauhaus
2008-11-25 20:49                                 ` Jeffrey R. Carter
2008-11-25 21:01                                   ` Adam Beneschan
2008-11-25 22:09                                     ` Georg Bauhaus
2008-11-25 22:33                                       ` Jeffrey R. Carter
2008-11-26  0:58                                         ` Adam Beneschan
2008-11-26  1:45                                           ` Jeffrey R. Carter
2008-11-26  9:31                                             ` Martin
2008-11-26  9:38                                               ` Stefan Bellon
2008-11-26  9:48                                                 ` Martin
2008-11-26 10:16                                                   ` Stefan Bellon
2008-11-26 11:05                                                     ` Ludovic Brenta
2008-11-26 11:33                                                       ` Stefan Bellon
2008-11-26 15:49                                                       ` Adam Beneschan
2008-11-26 16:15                                                         ` Ludovic Brenta
2008-11-26 11:10                                                 ` Niklas Holsti
2008-11-23  8:48                     ` Compiler quality (was: Extending discriminant types) Ludovic Brenta
2008-11-24 23:33                       ` anon
2008-11-25  6:54                         ` christoph.grein
2008-11-25 10:01                         ` Ludovic Brenta
2008-11-26 23:34                           ` anon
2008-11-27 10:24                             ` Compiler quality Georg Bauhaus
2008-11-27 14:46                               ` Ludovic Brenta
2008-11-28  9:13                                 ` Martin
2008-11-28 10:28                                   ` Georg Bauhaus
2008-12-02  3:51                                     ` Randy Brukardt
2008-11-22 13:10                 ` Extending discriminant types Gautier
2008-11-24  8:24                 ` christoph.grein
2008-11-21  6:11         ` christoph.grein
2008-11-21 21:12           ` Jeffrey R. Carter
2008-11-22 16:41             ` sjw
2008-11-21 11:44         ` Martin
2008-11-20  9:55     ` Martin
replies disabled

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