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!news1.google.com!postnews.google.com!y22g2000prd.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: numbers as 'generics' parameters Date: Fri, 16 May 2008 10:55:59 -0700 (PDT) Organization: http://groups.google.com Message-ID: <514f8014-235d-4f52-aae1-c5b862dd6594@y22g2000prd.googlegroups.com> References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1210960560 31763 127.0.0.1 (16 May 2008 17:56:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 16 May 2008 17:56:00 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y22g2000prd.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:110 Date: 2008-05-16T10:55:59-07:00 List-Id: 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