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!news.glorb.com!transit3.readnews.com!news-out.readnews.com!news-xxxfer.readnews.com!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: numbers as 'generics' parameters Date: Wed, 21 May 2008 11:32:33 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <42mXj.166735$yE1.38263@attbi_s21> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1211383953 30954 192.74.137.71 (21 May 2008 15:32:33 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 21 May 2008 15:32:33 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:S5Eeq9CUuUWJCaWAvf+zc5CeBxw= Xref: g2news1.google.com comp.lang.ada:278 Date: 2008-05-21T11:32:33-04:00 List-Id: "Jeffrey R. Carter" writes: > jhc0033@gmail.com wrote: >> 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? > > ARM 12.1 (http://www.adaic.org/standards/05rm/html/RM-12-1.html) lists 4 > kinds of generic formal parameters, only one of which is a type. So you > clearly haven't done much investigation of Ada. I don't think it's a good idea to learn Ada from the RM. Better to use a good textbook. I like Barnes. Anyway, it's not a sin to be ignorant of Ada. And generic formal objects are a pretty obscure and little-used feature -- MOST generic formal parameters are indeed types, so it's easy to get the incorrect impression that that's all there is. Now that Ada 2005 supports downward closures, even generic formal subprograms are (or should be) a little-used feature. - Bob