Skip to content

Instantly share code, notes, and snippets.

@gakuzzzz
Created September 19, 2012 22:56
Show Gist options
  • Save gakuzzzz/3752885 to your computer and use it in GitHub Desktop.
Save gakuzzzz/3752885 to your computer and use it in GitHub Desktop.
メソッド定義のパターンマッチ
scala> val hoge: (Int, Int, Int) => Int = {
| case (0, _, 1) => 2
| case (_, _, _) => 3
| }
hoge: (Int, Int, Int) => Int = <function3>
scala> hoge(0, 2, 1)
res0: Int = 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment