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 >> ruby-talk
ruby-talk
Re: delete_if_with_index or delete_at(array) in 1.8.6?
by Bil Kleb other posts by this author
Jul 2 2009 11:35AM messages near this date
Re: delete_if_with_index or delete_at(array) in 1.8.6? | Re: delete_if_with_index or delete_at(array) in 1.8.6?
David A. Black wrote:
>  In 1.8 I'm not coming up with anything more elegant than:
>  
> >> a.values_at(*(0...a.size).reject {|i| a[i] < i })
>  => [0, 1, 2, 4, 6, 7]

Nice.

--
http://twitter.com/bil_kleb
Thread:
Bil Kleb
David A. Black
Bil Kleb
James Gray
Robert Klemme
James Gray
Robert Klemme
Bil Kleb
Robert Klemme
Bil Kleb

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