In earlier versions of Scala you can use List.make(100, 1), but that is now deprecated. What is the new proper way to do it?
Asked
Active
Viewed 1,967 times
2 Answers
19
As described in the deprecated note:
@deprecated("use `fill' instead", "2.8.0")
try this:
List.fill(100)(1)

Tomasz Nurkiewicz
- 334,321
- 69
- 703
- 674