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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ab436e97ff76821f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.66.88.5 with SMTP id bc5mr1371165pab.11.1343570484580; Sun, 29 Jul 2012 07:01:24 -0700 (PDT) Path: c10ni48523pbw.0!nntp.google.com!news1.google.com!postnews.google.com!qk10g2000pbc.googlegroups.com!not-for-mail From: Robin Vowels Newsgroups: comp.lang.ada,comp.lang.pl1 Subject: Re: Does Ada need elemental functions to make it suitable for scientific work? Date: Sun, 29 Jul 2012 06:53:48 -0700 (PDT) Organization: http://groups.google.com Message-ID: <6581ef3f-3e2c-4eeb-9a3f-eded557239d5@qk10g2000pbc.googlegroups.com> References: <18c77859-480c-41f5-bb1c-df7ad067f4f3@googlegroups.com> <637de084-0e71-4077-a1c5-fc4200cad3cf@googlegroups.com> NNTP-Posting-Host: 123.2.70.40 Mime-Version: 1.0 X-Trace: posting.google.com 1343570484 671 127.0.0.1 (29 Jul 2012 14:01:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 29 Jul 2012 14:01:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: qk10g2000pbc.googlegroups.com; posting-host=123.2.70.40; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-07-29T06:53:48-07:00 List-Id: On Jul 20, 11:51=A0am, "Randy Brukardt" wrote: > "Nasser M. Abbasi" wrote in messagenews:jtgpos$20g$2@spe= ranza.aioe.org... > > > > > > > > > > > On 7/10/2012 3:02 AM, gautier.de.montmol...@gmail.com wrote: > >> Le mardi 10 juillet 2012 07:22:58 UTC+2, Ada novice a crit : > > >>> Believe me, for someone who do numerical computations on a daily basi= s, > >>> an operation > >>like V**2 is a NECESSITY. It's a pity that Ada does not offer such = a > >>facility. > >>I do not blame those who stick to Matlab (or Fortran?) for doing numeri= cal > >>computations. > > >> Wait... There are *such* facilities and several built-in operations > >> *like* that: > >>http://www.ada-auth.org/standards/12rm/html/RM-G-3-1.html > > >> Apparently it is not enough. But it is possible to make a proposal for > >> =A0the next standard (and short term for the next GNAT version). > > > That is a start. But not enough by any means. All functions should be > > vectorized. Even user defined ones. > > That would be a complete change in philosophy for Ada. The expectation is > that everything that can reasonably be done in libraries will be done tha= t > way. Note that Ada didn't add advanced containers directly in the syntax. > > It might be reasonable to propose to add additional operators to the Ada > language to make this more possible. We did look at that for Ada 2005 and > decided not to do it, mainly because most of the interesting operators ar= e > not unary or binary. (Think integration and differentiation.) > > > In Ada, I can't even take the sin of a vector > > Of course you can, with a trivial loop. > > =A0 =A0 =A0for E of Vect loop > =A0 =A0 =A0 =A0 =A0 =A0E :=3D Sin(E); > =A0 =A0 =A0end loop; Somewhat long-winded, wouldn't you say, when in Fortran and PL/I you can write it as E =3D sin(E); > And this has the distinct advantage of making it clear to other readers w= hat > it is that you are doing. No, it obfuscates what is happening. It is as verbose as the old-fashioned way of writing a loop: do i =3D 1, n; E(i) =3D sin(E(i)) end do end the equivalent in PL/I. > Note that in any case the Sin you are calling is not specially known to t= he > compiler, but in PL/I and Fortran it is.