supaham
08/06/2018, 3:33 PMval item1, item2, item3 = list
If so, is it possible to make it do a getOrNull?adam-mcneilly
08/06/2018, 3:36 PMsupaham
08/06/2018, 3:37 PMsupaham
08/06/2018, 3:37 PMkarelpeeters
08/06/2018, 3:37 PMval (item1, item2, item3) = list
, works up to 5 elements IIRC.adam-mcneilly
08/06/2018, 3:38 PMsupaham
08/06/2018, 3:38 PMadam-mcneilly
08/06/2018, 3:38 PMkarelpeeters
08/06/2018, 3:39 PMcomponentN
functions that return null
instead: val (item1, item2, item3) = list.destructOrNull()
supaham
08/06/2018, 3:40 PMadam-mcneilly
08/06/2018, 3:40 PMoperator fun <T> List<T>.component6(): T {
return this[5]
}
supaham
08/06/2018, 3:41 PMadam-mcneilly
08/06/2018, 3:41 PMkarelpeeters
08/06/2018, 3:41 PMdestructOrNull
would return an instace of something like class ListDestructorWrapper
that has those functions defined on it.