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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Thread: 101deb,15c6ed4b761968e6 X-Google-Attributes: gid103376,gid1094ba,gid101deb,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsdst02.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr14.news.prodigy.com.POSTED!2febb241!not-for-mail Reply-To: "Nasser Abbasi" From: "Nasser Abbasi" Newsgroups: comp.lang.ada,comp.lang.fortran,comp.lang.pl1 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> Subject: Re: Ada vs Fortran for scientific applications X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-RFC2646: Format=Flowed; Original Message-ID: NNTP-Posting-Host: 69.235.254.219 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr14.news.prodigy.com 1148533495 ST000 69.235.254.219 (Thu, 25 May 2006 01:04:55 EDT) NNTP-Posting-Date: Thu, 25 May 2006 01:04:55 EDT Organization: SBC http://yahoo.sbc.com X-UserInfo1: FKPO@S^DTZRUST@[ORK@_VXB\JT@QDDMEPWXODMMHXMTWA]EP]RAQFW[ML\THRCKV^GGZKJMGV^^_JSCFFUA_QXFGVSCYRPILH]TRVKC^LSN@DX_HCAFX__@J\DAJBVMY\ZWZCZLPA^MVH_P@\\EOMW\YSXHG__IJQY_@M[A[[AXQ_XDSTAR]\PG]NVAQUVM Date: Thu, 25 May 2006 05:04:55 GMT Xref: g2news2.google.com comp.lang.ada:4443 comp.lang.fortran:10230 comp.lang.pl1:1694 Date: 2006-05-25T05:04:55+00:00 List-Id: "robin" wrote in message news:6H9dg.10258$S7.9150@news-server.bigpond.net.au... > "Dick Hendrickson" wrote in message > news:%P_cg.155733$eR6.26337@bgtnsc04-news.ops.worldnet.att.net... > >> robin wrote: >> > "Dick Hendrickson" wrote in message >> > news:PkHcg.90575$Fs1.7198@bgtnsc05-news.ops.worldnet.att.net... >> > >> >>Ada's is surely better. Knowing that a subscript has to be >> >>in range, because it's checked when a value is assigned to >> >>the subscript variable, has to be more efficient than what >> >>Fortran can do. In general, Fortran has to check the value >> >>of the subscripts on every array reference. >> >> > It can do this only if it is a compiler option. >> > It is not a feature the language. >> >> There's a ambiguous "it" in those sentences. ;) >> >> But, if "it" refers to Fortran, subscript bounds rules >> ARE a feature of the language. > > Subscript bounds checking is not part of the Fortran language. > I just did this simple test, declare an array and go overbound and see if we get a run-time error: ----------------- FORTRAN 95 ------ $ g95 --version G95 (GCC 4.0.2 (g95!) Mar 3 2006) Copyright (C) 2002-2005 Free Software Foundation, Inc. $ cat f.f90 PROGRAM MAIN INTEGER A(10) DO I=1,11 A(I)=0 END DO END PROGRAM $ g95 f.f90 $ ./a.exe $ <------------------- NO runtime ERROR ---------------- ADA gnat2005 ---------- $ cat main.adb procedure Main is A : array( INTEGER RANGE 1..10) OF INTEGER; BEGIN FOR I IN 1..11 LOOP A(I):=0; END LOOP; END Main; gnatmake etc..... successful compilation/build $ ./main.exe raised CONSTRAINT_ERROR : main.adb:6 index check failed <---- ERROR Nasser