TwoClocks
07/24/2020, 12:09 AMlistOf(1,2,3,4).fold("") { acc, i -> acc }
but this doesn't listOf(1,2,3,4).fold("") { acc, i -> { acc } }
Or put another way : How do I write fold that is multi-statements and has some variables?Ruckus
07/24/2020, 12:12 AMephemient
07/24/2020, 12:12 AMlistOf(1, 2, 3, 4).fold("") { acc, i ->
statement1
statement2
}
(or separate them with semicolons, but why would you do that)TwoClocks
07/24/2020, 12:14 AMTwoClocks
07/24/2020, 12:14 AM