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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71c743c03ed191fe X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-20 05:17:26 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!HSNX.atgi.net!cyclone-sf.pbi.net!151.164.30.35!cyclone.swbell.net!newsfeed1.easynews.com!easynews.com!easynews!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Beginer problem: variable array size Date: Fri, 20 Sep 2002 08:11:11 -0400 Organization: MindSpring Enterprises Message-ID: References: <38993b18.0209191906.b56b982@posting.google.com> NNTP-Posting-Host: d1.56.b1.a6 X-Server-Date: 20 Sep 2002 12:16:07 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Xref: archiver1.google.com comp.lang.ada:29211 Date: 2002-09-20T12:16:07+00:00 List-Id: I'll agree with the "Hello World" example, but I've never seen the second one you cite as an example in a programming class. (Usually, the second program is "Read in two numbers and add them together...") And its a bit unfair to pull an example out like this and say "C++ can do this in N lines and it will take 10*N lines in Ada..." One can *always* rectally extract an example that makes language X look bad and language Y look good. (Illustration: "Reduce an N by M matrix of numbers..." - In some languages this can be done in one instruction. How many instructions does it take in C++?) The reality is that by putting a requirement out there that there must be no limit on the number of elements accepted, you create a difficulty that doesn't normally exist in the real world. The fact that I can't dynamically grow an array in Ada without building my own data structure isn't in practice going to prevent me from accomplishing a job. I just build the data structure or redefine the problem such that I can do it with a fixed data structure. Arrays in C++ can't dynamically grow either - you require a data structure that is built from the primitive ones. So C++ already has it built and that's nice, but its not something that can't readily be duplicated in Ada. If the problem is one of "How do I get my job done..." then the answer is to get hold of one of the many spiffy Ada libraries out there that will provide dynamic data structures. If the question is "How come Ada doesn't have any standard dynamic data structure libraries that ship with every compiler???" - well, I've been asking that question here for some time now. :-) BTW: I'm waiting for Ada to have some standard matrix & vector libraries so I can post to C++ newsgroups "Why can I multiply two matrices together in Ada in only one line of code and it takes me ten thousand to do it in C++..." :-) MDC -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jast.mil/ Send Replies To: m c o n d i c @ a c m . o r g "I'd trade it all for just a little more" -- Charles Montgomery Burns, [4F10] ====================================================================== Munch wrote in message news:38993b18.0209191906.b56b982@posting.google.com... > > The problem is: Prompt the user to enter in an Integers followed by > pressing , enter a 0 to terminate. At no point have a set > ceiling on how many integers can be in the array. Sort using whatever > sort algorithm makes you happy then display. >