comp.lang.ada
 help / color / mirror / Atom feed
From: christoph.grein@eurocopter.com
Subject: Re: Extending discriminant types
Date: Thu, 20 Nov 2008 00:30:16 -0800 (PST)
Date: 2008-11-20T00:30:16-08:00	[thread overview]
Message-ID: <26f0cb8c-eb3e-4c0d-85d1-f45e2c1ba4c6@j38g2000yqa.googlegroups.com> (raw)
In-Reply-To: ae8Vk.143630$Mh5.83121@bgtnsc04-news.ops.worldnet.att.net

On 20 Nov., 08:21, a...@anon.org (anon) wrote:
> Since, the orginal post suggest that the poster was using GNAT Ada 95
> compiler. Because the poster states that he can compiler the code. So,
> I used Gnat 3.15p using Ada 95 specs.
>
> Plus, the RM does not limited the "Base" attribute to only Scalar Types.
> Any defined type can use the "Base" attribute.

Wrong, it does. Please see the RM. You can take the 95 version, the 95
consolidated version, or the 2005 version. They all show you that
'Base is valid for scalar types only.

In my last post, I gave you chapter and verse, I repeat it here: K
(17).
This refers back to 3.5 Scalar Types, especially 3.5(15).

Form the kind of reference, you can deduce that there has been no
change since the very first publication of Ada 95. [Reference is in
the form C.V(p), where p is the paragraph number, here 15. It is
adorned with /1, if this paragraph was changed in the consolidated
version; with /2, if it was changed in the 2005 version.] So here you
see no change.

> Then you also have RM 2005 3.8.1 (17).

This is irrelevant in this context.

> --
> -- This specification was found on Ada-auth.org web site.
> --
> package U is
>   type T is tagged private ;
>
>   function "=" ( Left, Right : T'Base ) return Boolean ;
>
> private
>   type T is tagged null record ;
> end U ;

Hm, then this should never have compiled - GNAT is in error here (I
guess there are mistakes in every compiler on the world).

> the previous code is valid in Ada 95 but will not compile using GNAT
> Ada 2005 (2007 or 2008 versions).

OK, AdaCore have corrected the bug.

> And since a few here, like the "wiki" web sites:
>
> From:        http://en.wikibooks.org/wiki/Ada_Programming/Types

Please note that wiki has no normative force. You always have to be
suspicious about the contents. You have a good example here. The
chapter is partly wrong!

Now it was me who wrote lots of the stuff you quote here, so I'm the
culprit. I wrote the chapter with scalar types in mind - and in fact,
all this is true only for scalar types, not for composite types.



  reply	other threads:[~2008-11-20  8:30 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 [this message]
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
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