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,c3413343b4a6b2d6,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews1.google.com!not-for-mail From: jimmaureenrogers@worldnet.att.net (Jim Rogers) Newsgroups: comp.lang.ada Subject: Re: generic Integer for modular type bound Date: 15 Oct 2004 11:03:10 -0700 Organization: http://groups.google.com Message-ID: <82347202.0410151003.4aabf84f@posting.google.com> References: <416fd34a$0$29515$636a15ce@news.free.fr> NNTP-Posting-Host: 209.194.156.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1097863391 27052 127.0.0.1 (15 Oct 2004 18:03:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 15 Oct 2004 18:03:11 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:5257 Date: 2004-10-15T11:03:10-07:00 List-Id: Stany Marcel wrote in message news:<416fd34a$0$29515$636a15ce@news.free.fr>... > Hi, > > I tried to something like this: > > generic > Size : Integer; > > package MyGenPack > type MyType_T is mod Size; > > but It doesn't works because Size is not static, so is there an other nice > way to do this in Ada. Try the following: generic MyType_T is mod <>; package MyGenPack .... end MyGenPack; In other words, use a modular generic parameter rather than specifying a size. You might want to study the different kinds of generic parameters allowed by Ada. They are clearly defined in section 12.5 of the Ada Reference Manual. Jim Rogers