FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

list.next(steps)

 
Post new topic   Reply to topic     Forum Index -> Mango
View previous topic :: View next topic  
Author Message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Thu May 25, 2006 2:07 am    Post subject: list.next(steps) Reply with quote

Something that I've always considered missing from containers ([linked] lists particularly) was the ability to give .next() a number of steps to take. In other words, provide list.next(3) which would be the same as list.next.next.next. If it hits a null, it should just return null, rather than throw an exception. (Maybe I expected a null.)
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
teqdruid



Joined: 11 May 2004
Posts: 390
Location: UMD

PostPosted: Fri May 26, 2006 1:27 am    Post subject: Reply with quote

I assume that you're talking about container iterators...

You'd essentially like to be able to skip elements. iter.next(3) sounds like it returns a container with the next three elements in it. iter.skip(2).next or iter.advance(3) is what you want?
Back to top
View user's profile Send private message Send e-mail AIM Address
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Fri May 26, 2006 8:59 am    Post subject: Reply with quote

The .advance(3) form looks good... I see what you mean about .next(n) reading like a slice -- although that could be a neat trick too.
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Mango All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group