comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: Extending discriminant types
Date: Thu, 20 Nov 2008 23:01:12 GMT
Date: 2008-11-20T23:01:12+00:00	[thread overview]
Message-ID: <Y_lVk.36086$_Y1.12080@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: 49254e2d$0$30232$9b4e6d93@newsspool1.arcor-online.net

--
--  Compiles and Runs using GNAT 3.15p
--
--  This works in Ada 95 compilers because all types including a tag type 
--  has a discriminant value of at least 2 aka itself and Null. And that 
--  suggest that ALL types have a constraint of at least two. 
--
procedure V is

    type Point is tagged record
                           X : Float := 0.0 ;
                           Y : Float := 0.0 ;
                         end record ;
    type Point_Acesss is access all Point'Class ;

    type D is new Point with record
                           Z : Float := 0.0 ;
                         end record ;

    type E is new D with null record;
 
    Var : Point_Acesss ;

begin -- V
  Var := new E'Base ;
end V ;

In <49254e2d$0$30232$9b4e6d93@newsspool1.arcor-online.net>, Georg Bauhaus <rm.dash-bauhaus@futureapps.de> writes:
>Georg Bauhaus schrieb:
>> Ludovic Brenta schrieb:
>>> On Nov 20, 9:30 am, christoph.gr...@eurocopter.com wrote:
>>>> 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.
>>> One can also try GNAT GPL Edition 2008 or GCC 4.3 (or even 4.4) and
>>> pass it the -gnat95 option which is documented in the Secret GNAT
>>> User's Guide.
>> 
>> GNAT has -gnat83 as well, but rejects, too, because there are
>> neither tagged nor abstract types in Ada 83.
>> 
>> Just out of curiosity, given
>> 
>>    type T is tagged ...;
>>    type D is new T with ...;
>>    type E is new D with ...;
>> 
>> what would E'Base be?
>> 
>> Assuming that D is privately tagged, would E'Base
>> have different effects depending on whether E's tag
>> is visible or not?
>
>D's tag, ie.




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