Reputation: 11237
Is there a way to do something like:
0 to -10 map { i=>
...
}
repl gives me:
scala.collection.immutable.IndexedSeq[Unit] = Vector()
Upvotes: 14
Views: 9488
Reputation: 61041
Add the by
clause:
0 to -10 by -1
res0: Range(0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10)
Upvotes: 19