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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd3a5ba6349a6060 X-Google-Attributes: gid103376,public From: William Clodius Subject: Re: should I be interested in ada? Date: 1999/02/22 Message-ID: <36D1D862.41C6@lanl.gov>#1/1 X-Deja-AN: 447533251 Content-Transfer-Encoding: 7bit References: <7a72e6$g55$1@probity.mcc.ac.uk> <36C93BB4.1429@ecs.soton.ac.uk> <7afc1o$3mi$2@plug.news.pipex.net> <7afttr$7v3$1@nnrp1.dejanews.com> <7aganu$qsc$1@plug.news.pipex.net> <36CC3AEA.59E2@lanl.gov> <7ai502$6an$1@nnrp1.dejanews.com> <36CD8DBA.237C@lanl.gov> <7akvao$j5t$2@plug.news.pipex.net> Content-Type: text/plain; charset=us-ascii Organization: Los Alamos National Lab Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-22T00:00:00+00:00 List-Id: Nick Roberts wrote: > > This is a simple example, granted. But, it can be done without undue > difficulty in Ada by declaring an appropriate procedure: > > procedure Reorder (Object: in out Vector; Index: in Selection) is > Temp: constant Vector := Object; > begin > for i in Index'Range loop > Object(Index(i)) := Temp(i); > end loop; > end; > Even neglecting parallelization issues, the above code does not catch the semantics of the FORALL loop, in particular the FORALL does not require that either X or J be dimensioned 1:N, only that: 1. the index range include 1:N; 2. X's range include all values of J(1:N); and 3. the values of J(1:N) not have any duplicates. As a result Temp as declared above is assumed to be larger than the requirements might actually be, and Index might range past the desired bounds. -- William B. Clodius Phone: (505)-665-9370 Los Alamos Nat. Lab., NIS-2 FAX: (505)-667-3815 PO Box 1663, MS-C323 Group office: (505)-667-5776 Los Alamos, NM 87545 Email: wclodius@lanl.gov