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!newshub.sdsu.edu!sn-xt-sjc-02!sn-xt-sjc-01!sn-xt-sjc-07!sn-post-02!sn-post-sjc-01!supernews.com!news.supernews.com!nospam From: nospam@see.signature (Richard E Maine) Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Bounds Check Overhead Date: Thu, 25 May 2006 15:43:56 -0700 Organization: NASA Dryden Message-ID: <1hfwgpj.1lxd4e162sveiN%nospam@see.signature> 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> <4475DA61.3080001@comcast.net> <44762F55.4050106@cits1.stanford.edu> User-Agent: MacSOUP/2.7 (Mac OS X version 10.4.6) X-Complaints-To: abuse@supernews.com Xref: g2news2.google.com comp.lang.ada:4478 comp.lang.fortran:10262 Date: 2006-05-25T15:43:56-07:00 List-Id: Brooks Moses wrote: > The Fortran equivalent is: > > do i = lbound(Some_Array), ubound(Some_Array) > call Process(Some_Array(i)) > end do or, if that is really all that is in the loop, and if Process is elemental, just call Process(Some_Array) will do the trick quite nicely. The compiler will build the loop for you (or anyway, I think that's how most compilers implement elemental). But the restrictions on elemental procedures are quite stringent (so much so that I find it hard to do much useful with them except for the most fundamental of operations), so this isn't really a "fair" comparison. The version Brooks showed is more realistic in most cases. I just thought I'd mention the elemental possibility. -- Richard Maine | Good judgment comes from experience; email: my first.last at org.domain| experience comes from bad judgment. org: nasa, domain: gov | -- Mark Twain