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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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: g2news2.google.com!postnews.google.com!13g2000yql.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Extending discriminant types Date: Fri, 21 Nov 2008 03:54:13 -0800 (PST) Organization: http://groups.google.com Message-ID: 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> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1227268453 20526 127.0.0.1 (21 Nov 2008 11:54:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 21 Nov 2008 11:54:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 13g2000yql.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20070718 Red Hat/1.5.0.12-3.el5 Firefox/1.5.0.12,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:3701 Date: 2008-11-21T03:54:13-08:00 List-Id: On Nov 21, 12:01 am, a...@anon.org (anon) wrote: > -- 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 ; This compiles and runs with GNAT 3.15p only because GNAT 3.15p has a bug. -- Ludovic Brenta.