comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adambeneschan@gmail.com>
Subject: Re: Array index overloading
Date: Wed, 6 Aug 2014 12:43:12 -0700 (PDT)
Date: 2014-08-06T12:43:12-07:00	[thread overview]
Message-ID: <6f0e6013-6824-40fc-8b4f-fae3deb4bd99@googlegroups.com> (raw)
In-Reply-To: <dad0dc0f-80ff-4436-a380-298a3a933209@googlegroups.com>

On Wednesday, August 6, 2014 10:38:46 AM UTC-7, marmaduk...@univ-amu.fr wrote:
> So V(2 .. 4) is possible, but is the equivalent V((2, 3, 4)) ? How about V((9, 1, 2)) or V(((3, 3), (4, 5)))? It seems these cases fall outside the intrinsic indexing support providing by Ada.

V((2, 3, 4)) isn't legal Ada syntax.  If you want to create a three-element array taken from elements 9, 1, and 2 of V, you can write V(9) & V(1..2).  "&" is an array concatenation operator for 1-dimensional arrays (but it also accepts single values of the element type, such as V(9) in my example).

                                 -- Adam


  parent reply	other threads:[~2014-08-06 19:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 16:47 Array index overloading marmaduke.woodman
2014-08-06 16:53 ` Pascal Obry
2014-08-06 17:38   ` marmaduke.woodman
2014-08-06 19:25     ` Georg Bauhaus
2014-08-06 19:43     ` Adam Beneschan [this message]
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