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,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Attributes: gid103376,gid1094ba,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!news.glorb.com!newspeer2.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn_Persson?= User-Agent: Thunderbird 1.5.0.4 (X11/20060614) MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Ada vs Fortran for scientific applications References: <0ugu4e.4i7.ln@hunter.axlog.fr> <%P_cg.155733$eR6.26337@bgtnsc04-news.ops.worldnet.att.net> <6H9dg.10258$S7.9150@news-server.bigpond.net.au> <1hfv5wb.1x4ab1tbdzk7eN%nospam@see.signature> <2006052509454116807-gsande@worldnetattnet> <44B1763F.4050807@cits1.stanford.edu> In-Reply-To: <44B1763F.4050807@cits1.stanford.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Date: Mon, 10 Jul 2006 11:23:28 GMT NNTP-Posting-Host: 83.250.106.238 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1152530608 83.250.106.238 (Mon, 10 Jul 2006 13:23:28 CEST) NNTP-Posting-Date: Mon, 10 Jul 2006 13:23:28 CEST Organization: Telia Internet Xref: g2news2.google.com comp.lang.ada:5594 comp.lang.fortran:11876 Date: 2006-07-10T11:23:28+00:00 List-Id: Brooks Moses wrote: > type ncells is range 1..100; > type nfaces is range 0..100; > > cell : ncells; > leftface : nfaces; > rightface : nfaces; > > leftface = cell - 1; > rightface = cell; > > According your explanation those last two commands, while making logical > sense, would throw a type-mismatch error. How easy is that to "fix"? One solution is subtypes, as Jim showed. For cases where you don't want subtypes, there is explicit type conversion: leftface := nfaces(cell - 1); rightface := nfaces(cell); -- Bj�rn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu