Re:Underscore is a keyword in Java 9, use this script to che...
by nilved on Saturday January 14, 2017 @11:50AM
(#13399231)
The way Scala uses them is very different from Haskell or Prolog. They are used to create lambdas, not discardable placeholders. E.g. `List(1, 2, 3) map (_ + 1)`.
[ Parent
| on HN ]
Re:Underscore is a keyword in Java 9, use this script to che...
by pharrington on Saturday January 14, 2017 @02:48PM
(#13400198)
_ has a lot uses in Scala, one of them being to create lambdas, another as placeholders when pattern matching. for example val List(a, b, _, d) = List(1, 2, 3, 4)