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,f30ef262af690ce0 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!post01.iad01!roadrunner.com!not-for-mail From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: numbers as 'generics' parameters Organization: home References: <514f8014-235d-4f52-aae1-c5b862dd6594@y22g2000prd.googlegroups.com> User-Agent: MT-NewsWatcher/3.5.2 (PPC Mac OS X) Date: Fri, 16 May 2008 15:12:29 -0400 Message-ID: NNTP-Posting-Host: 24.164.82.230 X-Complaints-To: abuse@rr.com Xref: g2news1.google.com comp.lang.ada:116 Date: 2008-05-16T15:12:29-04:00 List-Id: In article <514f8014-235d-4f52-aae1-c5b862dd6594@y22g2000prd.googlegroups.com>, Adam Beneschan wrote: > On May 16, 10:26 am, "jhc0...@gmail.com" wrote: > > C++ allows integers as template parameters, so, for example I can > > define a vector of size N, and verify at compile time that, say, I > > don't try the inner product of a 2D (N=2) and 3D (N=3) vectors. On the > > other hand, I don't have to write separate versions of my code for > > various vector sizes. > > > > As far as I can tell, Ada does not allow anything but types as > > generics parameters, so what would be the approach to use with it? > > My recommended approach would be to read what the Ada reference manual > says about generics. Sorry to be so harsh, but your above assertion > ("does not allow anything but types") is so far off base that it > appears you've just gotten hold of some bad information, and that > needs to be fixed first. > > -- Adam Good places to start: John -- John B. Matthews trashgod at gmail dot com home dot woh dot rr dot com slash jbmatthews