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.9 required=5.0 tests=BAYES_00,FROM_NUMERIC_TLD autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4ff929aa5c2b2834 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!news.kjsl.com!news-peer-lilac.gradwell.net!not-for-mail From: "Stuart" Newsgroups: comp.lang.ada References: <1msd2xaahtsgv.f8io255x4f0n$.dlg@40tude.net> Subject: Re: Ranges and (non)static constraints Date: Fri, 17 Nov 2006 13:30:34 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-RFC2646: Format=Flowed; Original Message-ID: <455db67b_1@glkas0286.greenlnk.net> X-Original-NNTP-Posting-Host: glkas0286.greenlnk.net NNTP-Posting-Host: 20.133.0.1 X-Trace: 1163770241 news.gradwell.net 624 dnews/20.133.0.1:27343 X-Complaints-To: news-abuse@gradwell.net Xref: g2news2.google.com comp.lang.ada:7527 Date: 2006-11-17T13:30:34+00:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1msd2xaahtsgv.f8io255x4f0n$.dlg@40tude.net... > These are sufficiently different. Consider this example: > > N : constant := 2**64; -- Legal in GNAT > type T is range 1..N; -- Illegal in GNAT > > (This is not a bug) > > I would at least require the second be legal when the first is. Why? The first is a named value declaration (rather than a constant object declaration). In the type declaration I think the semantics of Ada require that the base type be a signed type, which thus introduces issues of symmetry around zero. Unfortunately I am in a bit of a rush at the moment so I don't have a chance to test an idea like: type T is mod N range 1..N-1; Regards -- Stuart