在 specs2 中有一个名为 Around 的方法,在此处记录,其中包含以下示例:
object http extends Around {
def around[T <% Result](t: =>T) = openHttpSession("test") {
t // execute t inside a http session
}
}
可以在此处找到此代码的源代码。
我很好奇 <% 运算符在这种情况下的含义是什么?
编辑:这是关于这个主题的可靠答案,什么是 Scala 上下文和视图边界?