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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9127c759a41fcfda X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-05 16:47:17 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!nycmny1-snf1.gtei.net!news.gtei.net!colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newspeer1-gui.server.ntli.net!ntli.net!newsfep3-gui.server.ntli.net.POSTED!53ab2750!not-for-mail From: "chris.danx" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1b) Gecko/20020721 X-Accept-Language: en-gb, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: [ot... well kindof] SDI References: <5ee5b646.0208040616.77f0460a@posting.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Inktomi-Trace: pc3-bbrg1-2-cust234.ren.cable.ntl.com 1028591236 23224 80.5.140.234 (5 Aug 2002 23:47:16 GMT) Message-ID: <88E39.2026$J47.25960@newsfep3-gui.server.ntli.net> Date: Tue, 06 Aug 2002 00:46:35 +0100 NNTP-Posting-Host: 80.3.128.4 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep3-gui.server.ntli.net 1028591236 80.3.128.4 (Tue, 06 Aug 2002 00:47:16 BST) NNTP-Posting-Date: Tue, 06 Aug 2002 00:47:16 BST Organization: ntl News Service Xref: archiver1.google.com comp.lang.ada:27735 Date: 2002-08-06T00:46:35+01:00 List-Id: Chad R. Meiners wrote: > Try, > > Robust_Input : > loop > begin > some_statement (some_parameters); > exit Robust_Input; > exception > when Some_Exception => Put_Line ("bad input"); > end; > end loop Robust_Input; Cheers, it's a bit clearer what the exit does in the above code than in mine, which is good. >>What about flabby coding? Can I ask how to tidy that up here? I have >>one snippets of Ada code, which is flabby and need to tidy it up, but am >>not sure exactly why it is flabby (actually I now think I know why it is >>flabby, just not how to make it tighter). > > If tidy code is code done the Ada way, I imagine you can have it critiqued > here. ok, the code is for multiplying two n*n matrics. type Matrix is array (1..n, 1..n) of Float; function prod (a, b : in Matrix) return Matrix is p : Matrix; begin for i in 1..n loop for j in 1..n loop p(i,j) := 0.0; for k in 1..n loop p(i,j) := p(i,j) + a(i,k)*b(k,j); end loop; end loop; end loop; end prod; This code does n*n*n iterations of the innermost loop, which I think is why the code is flabby (I think it can be done in less but am sure exactly how). Anyone got a pointer in the right direction? Chris