comp.lang.ada
 help / color / mirror / Atom feed
From: marmaduke.woodman@univ-amu.fr
Subject: Array index overloading
Date: Wed, 6 Aug 2014 09:47:09 -0700 (PDT)
Date: 2014-08-06T09:47:09-07:00	[thread overview]
Message-ID: <03d102e1-1c2f-4056-82d5-3eaaaffbb0f1@googlegroups.com> (raw)

Hi all,

I am new to Ada and have perhaps a boring question, coming from array oriented languages such as MATLAB & NumPy in Python: 

Is it possible to overload the indexing operator? For example, in the aforementioned languages, one could index with the value 1 to get the first element, or index with a vector [2, 3, 4] to obtain a vector of the 2nd, 3rd and 4th elements. 

Handling index arrays and generating an output array is something I can write, so my question is if the syntax can be overloaded, or I should expect to implement an explicit "slice" function? 


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 users of Ada in the scientific domains proceed: have I missed something or is idiomatic Ada array code written in looped style?


regards,
Marmaduke


             reply	other threads:[~2014-08-06 16:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 16:47 marmaduke.woodman [this message]
2014-08-06 16:53 ` Array index overloading Pascal Obry
2014-08-06 17:38   ` marmaduke.woodman
2014-08-06 19:25     ` Georg Bauhaus
2014-08-06 19:43     ` Adam Beneschan
2014-08-06 21:51     ` Pascal Obry
2014-08-06 23:53     ` Shark8
2014-08-06 17:36 ` Peter Chapin
2014-08-07  5:17   ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox