From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9b7d3a51d0d8b6ee X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news2!news.glorb.com!wn11feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: Extending discriminant types Reply-To: no to spamers (No@email.given.org) References: <20081115101632.5f98c596@cube.tz.axivion.com> <26f0cb8c-eb3e-4c0d-85d1-f45e2c1ba4c6@j38g2000yqa.googlegroups.com> <6fcfeaa4-e70c-4f58-aa69-0e5aac145000@x8g2000yqk.googlegroups.com> <49254dd7$0$30232$9b4e6d93@newsspool1.arcor-online.net> <49254e2d$0$30232$9b4e6d93@newsspool1.arcor-online.net> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Thu, 20 Nov 2008 23:01:12 GMT NNTP-Posting-Host: 12.65.12.191 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1227222072 12.65.12.191 (Thu, 20 Nov 2008 23:01:12 GMT) NNTP-Posting-Date: Thu, 20 Nov 2008 23:01:12 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:2718 Date: 2008-11-20T23:01:12+00:00 List-Id: -- -- 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 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.