i want to create a closure where it take all the Boolean expression and methods, gives the final result something like this
myAnd{
23<34
false
someFunction() //returns true
}
so the answer will be false
The solution i came with is this
fun myAnd(vararg flags: Boolean) = flags.all { it }
myAnd(true , false ,someFunction())
but this solution won't give the power of short circuiting while using and operator