From: Ryan <rtarpine@hotmail.com>
Subject: Re: Array-like object indexing
Date: Mon, 19 Aug 2002 15:33:51 -0400
Date: 2002-08-19T15:33:51-04:00 [thread overview]
Message-ID: <ajrh2j$1dce2m$1@ID-151722.news.dfncis.de> (raw)
In-Reply-To: x7vvg67e7fq.fsf@pushface.org
Simon Wright wrote:
> Ryan <rtarpine@hotmail.com> writes:
>
> The non-Ada C++ STL approach is to denote the end of the range by a
> value notionally one past the last valid element. It's not obvious
> that Last is the right name for an operation returning such a value,
> cf My_Array'Last.
Of course, that's just for iterators (which I am wrestling with
separately :). The STL name did always confuse me (Why is
My_String.end() actually *past* the last character of My_String?). I
like First and Last being the exact indicies because it lets me ask "if
Index not in First(My_Array)..Last(My_Array)". I've (since originally
asking) decided to put the responsibility on the user, but now I'm going
to try the Index_Type'Base suggestion I received.
Thanks,
Ryan
next prev parent reply other threads:[~2002-08-19 19:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-18 0:22 Array-like object indexing Ryan
2002-08-19 3:55 ` R. Tim Coslet
2002-08-19 5:36 ` Simon Wright
2002-08-19 19:33 ` Ryan [this message]
2002-08-19 19:49 ` Darren New
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox