Scala – can a lambda parameter match a tuple?

This is about the closest you can get:

 val m = l.filter { case (n, s) => n != 2 }

It’s basically pattern matching syntax inside an anonymous PartialFunction. There are also the tupled methods in Function object and traits, but they are just a wrapper around this pattern matching expression.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)