groostav
08/17/2016, 10:42 PMbounds()[ /*varargs*/ ]
is also very trivial, a class called ListAdapter
thats returned by the fun bounds()
, three lines of 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:
fun bounds() = ListAdapter<ClosedRange<Double>> { bounds -> //impl, needs to mutate its closure }