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,4ff929aa5c2b2834 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!proxad.net!proxad.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Ranges and (non)static constraints Date: Fri, 17 Nov 2006 17:45:57 +0100 Organization: Adalog Message-ID: <90pkje.l9l.ln@hunter.axlog.fr> References: <1pqs0gcno5o2t.1195tm9yap28b.dlg@40tude.net> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1163782895 3823 195.25.228.57 (17 Nov 2006 17:01:35 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 17 Nov 2006 17:01:35 +0000 (UTC) User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) In-Reply-To: Xref: g2news2.google.com comp.lang.ada:7534 Date: 2006-11-17T17:45:57+01:00 List-Id: Maciej Sobczak a �crit : > Jean-Pierre Rosen wrote: > >> 2) You want a "reasonable" type, given the capabilities of the >> machine. Either derive from Integer, or use Integer directly (not a >> bad choice for vector or matrix indices for example). That's what >> String did. But in that case, there is no reason to put an additional >> range constraint. What I was objecting to is putting a range on a >> derivation from Integer. > > Then imagine that the following apply (both): > 1. I want a "reasonable" type (matrix indices or even... strings), which > will play nice with the underlying machine architecture. > 2. I want a named subtype with dynamically determined constraints so > that I can use this named subtype in subsequent array definitions, > loops, etc. > > With such assumptions, the following: > > type T is new Integer range 1..N; > > seems reasonable, right? > Hmmm... What *I* would do is define: type My_Index is new Integer; and use unconstrained array definitions with that type. I would let the subtype to the user. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr