https://kotlinlang.org logo
#announcements
Title
# announcements
c

cedric

06/24/2016, 6:42 PM
Actually
takeWhile
is not going to work since it appears to not be reevaluated each time:
Copy code
var done = false
listOf(1,2,3,4).takeWhile{! done}.forEach {
    println(it)
    if (it >= 3) done = true
}
1234