Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法做类似的事情:
0 to -10 map { i=> ... }
repl 给了我:
scala.collection.immutable.IndexedSeq[Unit] = Vector()
0 to (-10, -1)
或者
0 to -10 by -1
添加by子句:
by
0 to -10 by -1 res0: Range(0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10)