Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 371011

Summary: [xtend.lib] Add more utilities to IterableExtensions
Product: [Modeling] TMF Reporter: Sebastian Zarnekow <sebastian.zarnekow>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: knut.wannheden, st.oehme, sven.efftinge
Version: 2.4.3   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard: v2.7

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.