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-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!headwall.stanford.edu!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: Sun, 09 Jul 2006 14:33:51 -0700 Organization: Stanford University Message-ID: <44B1763F.4050807@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> NNTP-Posting-Host: dnab42a428.stanford.edu Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.Stanford.EDU 1152480828 27049 171.66.164.40 (9 Jul 2006 21:33:48 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:5584 comp.lang.fortran:11859 Date: 2006-07-09T14:33:51-07:00 List-Id: adaworks@sbcglobal.net wrote: > Ada also uses the name-equivalence, rather than the structural equivalence > approach to checking (at compile time). Therefore, > > type N1 is range 0..100; > type N2 is range 0..100; > > with > > X : N1; -- X is of type N1 > Y : N2; -- Y is of type N2; > > will reject, > > X := Y +1; Y is incompatible, by name, with X; As a curiousity question, how would this work for cases such as, say, a finite-volume grid where I have one range for the cells, and another range for the faces between the cells, and want to do soemthing like this: 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"? - Brooks -- The "bmoses-nospam" address is valid; no unmunging needed.