部分函数在Kotlin中的应用

我在部分函数应用的语法上遇到了麻烦。 下面的代码工作正常,它输出: two-three-four

 import kotlin.coroutines.experimental.* inline fun <T> Iterable<T>.forEachFrom(beg:Int, act:(T)->Unit) { var i=0; if (beg>=0) for (e in this) if (i++ >= beg) act(e) } // sample function I am testing; please don't change this! fun main(a:Array<String>) { val l = listOf("zero", "one", "two", "three", "four") fun test() = buildSequence { l.forEachFrom(2) { yield(it) } }.joinToString("-") println(test()) } 

我想封装我的test() ,所以它被称为: test(l.forEachFrom(2))但是,我似乎无法得到的类型/语法正确。 我将如何重写test()函数定义,使之成为可能?