Scala - complex conditional pattern matching

Viewed 26295

I have a statement I want to express, that in C pseudo-code would look like this:

switch(foo):
    case(1)
        if(x > y) {
            if (z == true)
                doSomething()
            }
            else {
                doSomethingElse()
            }
        return doSomethingElseEntirely()

    case(2)
        essentially more of the same

Is a nice way possible with the scala pattern matching syntax?

1 Answers
Related