Ray Rahke
02/21/2024, 8:36 PMRay Rahke
02/21/2024, 8:38 PMc()
always being executed as the ;
breaks it outside of the else, despite them being on the same line.Ray Rahke
02/21/2024, 8:38 PMelse
b() && c()
but this only works for boolean functionsCasey Brooks
02/21/2024, 8:39 PMRay Rahke
02/21/2024, 8:39 PMRay Rahke
02/21/2024, 8:40 PMCasey Brooks
02/21/2024, 8:40 PMelse
without needing them on if
)
if (condition)
a()
else
{ b(); c() }
Ray Rahke
02/21/2024, 8:40 PMRay Rahke
02/21/2024, 8:41 PMRay Rahke
02/21/2024, 8:41 PMRay Rahke
02/21/2024, 8:41 PMRay Rahke
02/21/2024, 8:41 PMephemient
02/21/2024, 8:45 PMfun run(vararg blocks: () -> Unit) {
for (block in blocks) block()
}
if (condition) a() else run(::b, ::c)
ephemient
02/21/2024, 8:47 PMRay Rahke
02/21/2024, 8:48 PMRay Rahke
02/21/2024, 8:48 PMRay Rahke
02/21/2024, 8:49 PMJeff Lockhart
02/21/2024, 10:34 PMephemient
02/21/2024, 10:35 PM{
, because of how easily that could be interpreted as a lambda in Kotlin