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!news3.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!scrotar.nss.udel.edu!not-for-mail From: Rich Townsend Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Bounds Check Overhead Date: Fri, 26 May 2006 16:06:05 -0400 Organization: University of Delaware Message-ID: 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> NNTP-Posting-Host: shayol.bartol.udel.edu Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: scrotar.nss.udel.edu 1148673956 3723 128.175.14.63 (26 May 2006 20:05:56 GMT) X-Complaints-To: abuse@udel.edu NNTP-Posting-Date: Fri, 26 May 2006 20:05:56 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.8 (X11/20060417) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news2.google.com comp.lang.ada:4515 comp.lang.fortran:10314 Date: 2006-05-26T16:06:05-04:00 List-Id: Simon Wright wrote: > Rich Townsend writes: > > >>Also, from looking at your Ada program, it seems you can't pass loop >>counters to procedures. Is this the case? > > > No, it was the 'in out' on the parameter that was forbidden. > > We can say > > procedure Foo (X : Integer); > procedure Foo (X : in Integer); > > with the same meaning, I suspect the same as your intent(in), and > within Foo X is treated as constant; > > procedure Foo (X : out Integer); > > where the initial value of X is not accessible within Foo (though its > constraints, eg array bounds, are); and > > procedure Foo (X : in out Integer); > > where the initial value is accessible. I think this is the default > Fortran mode? Yes. Without an explicit INTENT(), Fortran defaults to INTENT(inout) -- and I guess Ada defaults to INTENT(in), which is 'safer', but could not be done in Fortran due to the requirement of backward compatibility. cheers, Rich