るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.011秒)
トップページ > クエリ:throw[x] > バージョン:2.3.0[x] > 種類:関数[x]

別のキーワード

  1. kernel throw
  2. _builtin throw
  3. minitest/spec must_throw
  4. rb_throw

キーワード

検索結果

void rb_throw(const char *tag, VALUE val) (18352.0)

throw の実体。返り値を val として、 tag を catch したところまでジャンプします。

throw の実体。返り値を val として、
tag を catch したところまでジャンプします。

rb_catch も参照してください。

static VALUE rb_f_throw(int argc, VALUE *argv) (18304.0)

VALUE rb_catch(const char *tag, VALUE (*proc)(), VALUE data) (76.0)

catch と同等の動作を実行します。

catch と同等の動作を実行します。

まず proc に、yield された値と data を渡して実行します。
その途中で tag が throw されたら rb_catch 全体を終了します。

throw が発生した場合はその値を返します。
throw が発生しなかったときは proc の返り値を返します。

static VALUE
foo_yield(VALUE a, VALUE b)
{
return rb_yield(b);
}

static VALUE
foo_catch(VALUE obj)
{
return rb_...