Skip to content

Instantly share code, notes, and snippets.

@kodaitakahashi
Created October 5, 2016 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kodaitakahashi/caca0d9aa90e322894a5faa117103397 to your computer and use it in GitHub Desktop.
Save kodaitakahashi/caca0d9aa90e322894a5faa117103397 to your computer and use it in GitHub Desktop.
Kernel.#catch Kernel.#throwの構文
# catchの構文
catch (tag) do
# tag => 終了する場ためのオブジェクト throwから送られてくるものと一致する必要がある。
# throwの構文
throw (tag, value)
# tag => catchで定義した同一のオブジェクト
# value => 処理を終了した時の戻り値
# catchで定義しオブジェクトと同一ではない場合、 UncaughtThrowErrorが発生する。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment