在 Scala 中编写简单的递归函数时,我不断收到此错误。我错过了什么?
scala> def count(n1:Int, n1:Int) : List[Int] = (n1 < n2) ? List() : List(n1, count((n1 - 1), n2))
<console>:1: error: ';' expected but '(' found.
def count(n1:Int, n1:Int) : List[Int] = (n1 < n2) ? List() : List(n1, count((n1 - 1), n2))