Created
October 1, 2012 02:18
-
-
Save gakuzzzz/3809125 to your computer and use it in GitHub Desktop.
Ruby の rescue retry 的な何か
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.annotation.tailrec | |
import scala.util.control.Exception._ | |
@tailrec | |
def hoge: A = { | |
allCatch opt { | |
なんか失敗するかもな処理 | |
} match { | |
case Some(a) => a | |
case None => hoge | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment