ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-language
perl6-language
Re: bidirectional iterators
by Larry Wall other posts by this author
Aug 30 2004 7:12PM messages near this date
bidirectional iterators | Re: Return with no expression
On Mon, Aug 23, 2004 at 03:31:39PM -0700, David Storrs wrote:
: There has been a lot of discussion in the other threads lately about
: iterators.  I was wondering if there will be an easy way to create a
: bidirectional iterator?  Toy example to show what I'm thinking:
: 
: for(1..10) {
:     next if /7/;          # always skip 7
:     prev if 9 && !rand 3; # occasionally backup and redo 8
: 
:     print;
: }

My feeling on the matter is that there are some object types that can
support bidirectional iterators, and it's fine to call .prev on such
an object explicitly, but supporting such on the implicit list of a
loop is probably overkill for the number times people will actually
want it.  In fact, nobody has ever asked for it before...

Larry
Thread:
David Storrs
Larry Wall

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved