【发布时间】:2015-07-27 17:24:39
【问题描述】:
在 Scala 中,我创建了一个列表,然后根据类条件对其进行过滤:
val list: List[MyObj] = // fill in with objects that extend MyObj, one of them is class A
val list2 = list filter ({ case A() => false case _ => true })
上面的过滤器可以写成更简洁的形式吗?
【问题讨论】: