Created
October 5, 2016 09:09
-
-
Save kodaitakahashi/caca0d9aa90e322894a5faa117103397 to your computer and use it in GitHub Desktop.
Kernel.#catch Kernel.#throwの構文
This file contains 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
# catchの構文 | |
catch (tag) do | |
# tag => 終了する場ためのオブジェクト throwから送られてくるものと一致する必要がある。 |
This file contains 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
# 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