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!news.glorb.com!newsgate.cistron.nl!transit.news.xs4all.nl!xs4all!border2.nntp.ams.giganews.com!nntp.giganews.com!sn-ams-06!sn-xt-ams-03!sn-ams!sn-feed-ams-02!sn-post-ams-01!sn-post-sjc-01!supernews.com!news.supernews.com!nospam From: nospam@see.signature (Richard Maine) Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Bounds Check Overhead Date: Fri, 26 May 2006 13:28:51 -0700 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <1hfy4xh.xeesc61gidq8eN%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> <87hd3d1472.fsf@ludovic-brenta.org> <1hfxsjh.t88mchrssv9cN%nospam@see.signature> User-Agent: MacSOUP/2.7 (Mac OS X version 10.4.4) X-Complaints-To: abuse@supernews.com Xref: g2news2.google.com comp.lang.ada:4519 comp.lang.fortran:10319 Date: 2006-05-26T13:28:51-07:00 List-Id: Rich Townsend wrote: > Yes. Without an explicit INTENT(), Fortran defaults to INTENT(inout) That is not true. Fortran has 4 distinct intent() values - in, out, inout, and unspecified. All 4 are different. The unspecified case is sort of like inout, but it is *NOT* the same. The unspecified case is largely historical. It means what it has to for compatibility with old codes, which turns out to be a bit messy. I doubt that anyone would come up with such a thing from scratch today... but they didn't. I might describe the unspecified case as "who knows?" The argument might be for input, It might be for output. It might be both, and it might play different roles at different times. A particular difference between unspecified and inout is that the actual argument must be definable for inout. Mostly that means it has to be a variable - not an expression. For unspecified, the actual argument only has to be definable if the dummy gets defined or redefined on that particular invocation; yes, it can be different on different invocations. The distinction is important to the case in question. Using a DO index variable as an actual argument for an intent(inout) dummy is at least questionable. I don't recall whether or not it is prohibitted, but it is at least something worth a warning anyway. Using a DO index variable as an actual argument for an unspecified intent dummy is normal, widespread practice in old codes - after all, that is the only kind of intent there was, and passing DO index variables as actual arguments is often useful. -- Richard Maine | Good judgement comes from experience; email: last name at domain . net | experience comes from bad judgement. domain: summertriangle | -- Mark Twain