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,a1d2fe1ec5136718 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Generic warning Date: Wed, 18 Jun 2008 11:10:29 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4858CA3B.7030101@gmail.com> <626i5415pe8s2jekhij85k4algrh9i1jfo@4ax.com> <48591C7C.8050304@gmail.com> <9kpc0dqlpz0w$.u1qnk7e1zznp$.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pcls4.std.com 1213801829 8653 192.74.137.71 (18 Jun 2008 15:10:29 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 18 Jun 2008 15:10:29 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:YaRViQg7ZiUK5VdOboZJ6gK5sL8= Xref: g2news1.google.com comp.lang.ada:764 X-Original-Bytes: 2060 Date: 2008-06-18T11:10:29-04:00 List-Id: "Dmitry A. Kazakov" writes: > On Wed, 18 Jun 2008 14:32:28 +0000, S�bastien Morand wrote: > >>> (Newbie qiestion, coming from VHDL, halfway through the Barnes book) >>> >>> Can you not create a subtype of Positive to reflect that, and declare >>> both the array and index using that subtype? >> >> I can't create a subtype using a parameter. > > No, no, you mean a *type*. > >> generic >> Order: Positive; >> package Test is >> -- Can't work since Order is not defined at compile time >> type MyType is range 1 .. Order; > > This would be a type. But you do can create a subtype: > > subtype Index is range 1..Order; -- This is OK > > Subtypes can be dynamically constrained. Yes. You can also create a new type: type Index is new Positive range 1..Order; - Bob