有没有办法做这样的事情:
0 to -10 map { i=>
...
}
repl 给了我:
scala.collection.immutable.IndexedSeq[Unit] = Vector()
最佳答案
0 to (-10, -1)
或
0 to -10 by -1
关于scala - 如何以负步长迭代范围?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13423180/