19.4. match
is not a closure
One thing to keep in mind is that match
returns a value, and that it is not a closure unless you
want it to.
let foo = match {
case plop then 1
case ploped then 2
otherwise -1
}
# Ok
println(foo)
# Bad! foo is an integer!
println(foo("abc"))