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,4692663255b51613 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: Re: on using array index, vectorized operation Date: Sun, 27 Mar 2011 15:23:17 -0700 Organization: Aioe.org NNTP Server Message-ID: References: Reply-To: nma@12000.org NNTP-Posting-Host: tUYQ4Ty9mMw9Pdc8TJRFQA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.ada:19489 Date: 2011-03-27T15:23:17-07:00 List-Id: On 3/27/2011 3:09 PM, Phil Clayton wrote: > > Do we now have vectorized arithmetic operations, e.g. + on array > types? > Does not look like it either, not directly any way: --------------------- procedure foo2 is type array_t is array(natural range <>) of integer; u : array_t(1..10) := (others=>0); begin u := u + 1; end foo2; ------------------- $ gnatmake foo2.adb gcc-4.4 -c foo2.adb foo2.adb:7:09: expected type universal integer foo2.adb:7:09: found type "array_t" defined at line 3 gnatmake: "foo2.adb" compilation error I am trying to figure a solution to this problem now. But I am just learning Ada myself. But I have to admit when it comes to working with arrays and such, these things are easier in Fortran: ------------------- program t implicit none integer :: A(1:5) = 0 A = A + 1 print *,A end program t ----------------- $ gfortran -Wall foo.f90 $ ./a.out 1 1 1 1 1 $ --Nasser