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,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!news.cs.univ-paris8.fr!informatik.uni-bremen.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: Tue, 14 Sep 2004 17:32:26 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <49dc98cf.0408110556.18ae7df@posting.google.com> <413e2fbd$0$30586$626a14ce@news.free.fr> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1095183146 14125 134.91.1.34 (14 Sep 2004 17:32:26 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Tue, 14 Sep 2004 17:32:26 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:3732 Date: 2004-09-14T17:32:26+00:00 List-Id: Kevin Cline wrote: : C++ : is an excellent language for writing such a library, No doubt. : because template : functions can instantiate new types automatically, e.g. But that is not the only reason that C++ is an excellent language for writing such a library? : template : matrix operator*(const matrix& lhs, conat matrix& : rhs) {...} Note that all the instantiations appear to be there in order to have bounded arrays. I think. It might be an advantage that the ranges are known to match; I guess this is different from what Ada's gives you when the compiler cannot find out at compile time: "Note that errors such as when bounds of arrays do not match raise Constraint_Error by analogy with built-in array operations." (from the AI mentioned below.) : You could do the same in Ada, but first you would have to explicitly : instantiate the five functions. That gets old really fast. I might not have to do the same thing, because Ada arrays and matrices tend to come with their bounds determined when a matrix object is declared and assigned. :-) The latest on Vector and Matrix ops for Ada 200Y is available in http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AI-00296.TXT?rev=1.17 : This ground is covered extensively in Scientific and Engineering C++ : : An Introduction with Advanced Techniques and Examples by John J. : Barton, Lee R. Nackman. Thanks for the pointer. :> : I very rarely have any need or use :> : for a statically sized array. :> x: Vec := make(5); : : But even though X has a run-time determined size, its size is now : fixed. I can neither add or remove elements without creating an : entirely new vector. Sure. That's a property of the built in arrays. They are not flex arrays. Would you want to change the size of a matrix, too? -- Georg