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

Shawn

12/01/2017, 7:38 PM
maybe a dumb question, but, does the index in
foldIndexed()
start at 0?
it does, my problem was something else 😅
k

karelpeeters

12/01/2017, 8:49 PM
If you're in doubt you can just call
println
inside of the lambda.
s

Shawn

12/01/2017, 11:08 PM
I did do this, actually, but it wasn’t matching what I’d get when I set a breakpoint and evaluated what
index
was in the middle of the lambda, which threw me off a bit
thought I was off by one, but I wasn’t quite ¯\_(ツ)_/¯
k

karelpeeters

12/01/2017, 11:11 PM
Really? The debugger should work fine I think, although line numbers can be wrong when dealing with inline functions.
s

Shawn

12/01/2017, 11:14 PM
This is honestly probably just a case of me misinterpreting the state of things, but while execution was paused, the IDE showed me two
index
values on that line, e.g.
index: 0 index$iv: 1
and when I evaluated index, it ostensibly gave me
index$iv
3 Views