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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.50.103.66 with SMTP id fu2mr4224122igb.7.1407343629901; Wed, 06 Aug 2014 09:47:09 -0700 (PDT) X-Received: by 10.140.31.73 with SMTP id e67mr25857qge.30.1407343629858; Wed, 06 Aug 2014 09:47:09 -0700 (PDT) Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!h18no15133509igc.0!news-out.google.com!b3ni5177qac.1!nntp.google.com!j15no5008728qaq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 6 Aug 2014 09:47:09 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=92.153.31.174; posting-account=aGJoogoAAADkh4ZckTF6FGwS5XiD8DE2 NNTP-Posting-Host: 92.153.31.174 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <03d102e1-1c2f-4056-82d5-3eaaaffbb0f1@googlegroups.com> Subject: Array index overloading From: marmaduke.woodman@univ-amu.fr Injection-Date: Wed, 06 Aug 2014 16:47:09 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.dca.giganews.com comp.lang.ada:188191 Date: 2014-08-06T09:47:09-07:00 List-Id: Hi all, I am new to Ada and have perhaps a boring question, coming from array orien= ted languages such as MATLAB & NumPy in Python:=20 Is it possible to overload the indexing operator? For example, in the afore= mentioned languages, one could index with the value 1 to get the first elem= ent, or index with a vector [2, 3, 4] to obtain a vector of the 2nd, 3rd an= d 4th elements.=20 Handling index arrays and generating an output array is something I can wri= te, so my question is if the syntax can be overloaded, or I should expect t= o implement an explicit "slice" function?=20 A more general question: from my brief searches on the internet, I have not= uncovered a generic N-dimensional array library, and I am curious how user= s of Ada in the scientific domains proceed: have I missed something or is i= diomatic Ada array code written in looped style? regards, Marmaduke