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!news2.google.com!news4.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail From: Brooks Moses Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Ada vs Fortran for scientific applications Date: Mon, 10 Jul 2006 10:08:24 -0700 Organization: Stanford University Message-ID: <44B28988.3060306@cits1.stanford.edu> 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> NNTP-Posting-Host: dnab42a4bd.stanford.edu Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.Stanford.EDU 1152551294 23880 171.66.164.189 (10 Jul 2006 17:08:14 GMT) X-Complaints-To: news@news.stanford.edu User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news2.google.com comp.lang.ada:5596 comp.lang.fortran:11894 Date: 2006-07-10T10:08:24-07:00 List-Id: Bj�rn Persson wrote: > Brooks Moses wrote: >> 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); Thanks to you both. This does look like a useful language feature, indeed, particularly with the subtypes. - Brooks -- The "bmoses-nospam" address is valid; no unmunging needed.