我在 Scala 中发现了占位符的“奇怪”用法:在precompiler-in-scala
class Precompiler {
var sources = Array[File]()
var workingDirectory: File = _
var targetDirectory:File = _
var templates = Array[String]()
var info:{def apply(v1:String):Unit} = (value:String)=>println(value)
var contextClass:String = _
var bootClassName:String = _
// ...
}
这是偏函数吗?还是别的什么?是否有任何演示可以显示这样的占位符的用法?