At 1:08 PM -0600 6/14/04, Luke Palmer wrote:
Dan Sugalski writes:
 Once we decide how to *get* these things (see the previous e-mail) we
 need to decide how they should work. We can fiddle around, but
 honestly the scheme:

 1) They act as arrays--if you want the 18th element in the iterator,
 access it directly
 2) They have 'next', 'previous', 'first', 'last', and 'reset' methods
 to get the next, previous, first, or last element in the iterator, or
 to reset the iterator to the beginning. Next, last, and reset change
 the internal current element pointer, first and last don't.

Why not take a page from C++ and call "previous" and "next" C<inc> and C<dec>, and then C<deref> to get what it points to.

Because ++ and -- affect the value not the container. (There are days when I think "C++ does it like..." is the near-perfect argument against doing it one particular way... :) Next and previous are actions on the container.
--
Dan


--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to