Join Slack
Powered by
May I ask a question? What’s the point of these ex...
# android
h
heehawgr
09/02/2019, 8:58 AM
May I ask a question? What’s the point of these extension methods in the source code of _Collections.kt? Occasionally find them while reading codes, a little bit confused😶
g
gildor
09/02/2019, 9:02 AM
to provide destructuring for lists
https://kotlinlang.org/docs/reference/multi-declarations.html
gildor
09/02/2019, 9:04 AM
you can do this for simple destructuring first 5 items of any list:
Copy code
val (first, second, third) = someList
gildor
09/02/2019, 9:04 AM
Also not related to
#android
,
#getting-started
is better place for such questions
h
heehawgr
09/02/2019, 9:07 AM
@gildor
Thx for reply :) I’ll pay attention next time😅
Open in Slack
Previous
Next