pattern matching on ranges

This commit is contained in:
Dmitry Jemerov
2011-05-19 16:30:23 +02:00
parent cd96508c63
commit 5bbb99e247
3 changed files with 22 additions and 0 deletions
@@ -0,0 +1,4 @@
fun isDigit(a: Int) = when(a) {
in 0..9 => "digit"
else => "something"
}