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,4ff929aa5c2b2834 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ranges and (non)static constraints Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1msd2xaahtsgv.f8io255x4f0n$.dlg@40tude.net> <455db67b_1@glkas0286.greenlnk.net> Date: Fri, 17 Nov 2006 16:07:23 +0100 Message-ID: NNTP-Posting-Date: 17 Nov 2006 16:07:23 CET NNTP-Posting-Host: d5ac82f2.newsspool4.arcor-online.net X-Trace: DXC=V44am0Da59nPKPPVf;4hUj4IUK4WKQd`d[c X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7529 Date: 2006-11-17T16:07:23+01:00 List-Id: On Fri, 17 Nov 2006 13:30:34 -0000, Stuart wrote: > "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. So? Let it allocate two 64-bit words! It is not my business, Ada is a higher-level language. > 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; You mean: type T is mod N; subtype S is T range 1..N; No, that won't work. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de