the code to get `bounds()[ /*varargs*/ ]` is also ...
# random
g
the code to get
bounds()[ /*varargs*/ ]
is also very trivial, a class called
ListAdapter
thats returned by the
fun bounds()
, three lines of code:
Copy code
class ListAdapter<T>(private val consumer: (List<T>) -> Unit){
            operator fun get(vararg args: T) = consumer(args.toList());
        }
allows you to define code like this:
Copy code
fun bounds() = ListAdapter<ClosedRange<Double>> { bounds -> //impl, needs to mutate its closure }