Skip to content

Instantly share code, notes, and snippets.

@yoshiori
Created May 9, 2012 16:38
Show Gist options
  • Save yoshiori/2646399 to your computer and use it in GitHub Desktop.
Save yoshiori/2646399 to your computer and use it in GitHub Desktop.
単に評価順じゃね???
scala> val txt = "foo" + "bar" match { case s => {println(s);s} }
foobar
txt: java.lang.String = foobar
scala> val txt = "foo" + ("bar" match { case s => {println(s);s} })
bar
txt: java.lang.String = foobar
だから
val filePath = "src/main/webapp/" + path match {
case tentenRegex() => throw new Exception
case "/" => "/index.html"
case _ => path
}
val filePath = "src/main/webapp/" + (path match {
case tentenRegex() => throw new Exception
case "/" => "/index.html"
case _ => path
})
にすればいいのでは???
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment