Scala placeholder syntax

后端 未结 2 900
伪装坚强ぢ
伪装坚强ぢ 2021-01-13 12:51

There is something that I can\'t quite understand hope someone can shed some light.. I have Seq[String]

val strDeps: Seq[String] = ...

and

2条回答
  •  误落风尘
    2021-01-13 13:29

    _ expands only to the smallest possible scope.

    The inner _.reverse part is already interpreted as x => x.reverse therefore the parameter is missing inside sortWith.

提交回复
热议问题