Skip to content

Instantly share code, notes, and snippets.

@gakuzzzz
Created October 1, 2012 02:18
Show Gist options
  • Save gakuzzzz/3809125 to your computer and use it in GitHub Desktop.
Save gakuzzzz/3809125 to your computer and use it in GitHub Desktop.
Ruby の rescue retry 的な何か
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