Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 371011 - [xtend.lib] Add more utilities to IterableExtensions
Summary: [xtend.lib] Add more utilities to IterableExtensions
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.4.3   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: v2.7
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-08 16:37 EST by Sebastian Zarnekow CLA
Modified: 2017-10-31 11:16 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Zarnekow CLA 2012-02-08 16:37:03 EST
It may be useful to have something like

takeWhile(Iterable, Predicate):Iterable
dropWhile(Iterable, Predicate):Iterable

Having some generator functions would be nice, too, e.g. one could write

val initial = 1
val Iterable<Integer> iterable = initial.seed [ int i | i * 2 ]

to generate an infinite sequence 1, 2, 4, 8, 16...
Comment 1 Knut Wannheden CLA 2012-02-09 03:19:48 EST
+1. There is also a Guava feature request for takeWhile and dropWhile: http://code.google.com/p/guava-libraries/issues/detail?id=477
Comment 2 Stefan Oehme CLA 2014-07-18 07:20:46 EDT
takeWhile and droWhile are merged into master

https://git.eclipse.org/r/#/c/30031/

an an iterate function is requested in Bug 431213
Comment 3 Eclipse Webmaster CLA 2017-10-31 11:05:25 EDT
Requested via bug 522520.

-M.
Comment 4 Eclipse Webmaster CLA 2017-10-31 11:16:46 EDT
Requested via bug 522520.

-M.