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!k10g2000prm.googlegroups.com!not-for-mail From: "jimmaureenrogers@worldnet.att.net" Newsgroups: comp.lang.ada Subject: Re: numbers as 'generics' parameters Date: Fri, 16 May 2008 11:34:53 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5a0ab942-667d-4da9-92d6-f1f4d5c82ac8@k10g2000prm.googlegroups.com> References: NNTP-Posting-Host: 75.70.240.233 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1210962893 8640 127.0.0.1 (16 May 2008 18:34:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 16 May 2008 18:34:53 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k10g2000prm.googlegroups.com; posting-host=75.70.240.233; posting-account=fZH-XgkAAADP-Rf8L8ppyFIdKUfh90k4 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:112 Date: 2008-05-16T11:34:53-07:00 List-Id: Ada does not require the definition of a generic for your example. Ada provides the ability to define unconstrained array types. For example, the following package specification defines a vector type and some operations on that type. package Vectors is subtype Index_Type is Integer range 1..Integer'Last; type Vector is array(Index_Type range <>) of Float; function "*"(Left : Float; Right : Vector) return Vector; function "*"(Left : Vector; Right : Float) return Vector; function "*"(Left, Right : Vector) return Vector; function "-"(Left : Float; Right : Vector) return Vector; function "-"(Left : Vector; Right : Float) return Vector; function "-"(Left, Right : Vector) return Vector; function "+"(Left : Float; Right : Vector) return Vector; function "+"(Left : Vector; Right : Float) return Vector; function "+"(Left, Right : Vector) return Vector; function "/"(Left : Vector; Right : Float) return Vector; end Vectors; Ada provides both compile-time and run-time checks on the array bounds for type Vector, even though an instance of Vector can be of any size up to Integer'Last. Your questions about Ada indicate very little exposure to Ada. I concur with Adam's recommendation above. Please read up on Ada. You will find the language to be very usable and very efficient. Jim Rogers