るりまサーチ (Ruby 3.3)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.038秒)
トップページ > クエリ:Class[x] > クエリ:on[x] > バージョン:3.3[x] > クエリ:rb_catch[x]

別のキーワード

  1. optparse on
  2. optionparser on
  3. tracer on
  4. thread abort_on_exception
  5. _builtin abort_on_exception

検索結果

VALUE rb_catch(const char *tag, VALUE (*proc)(), VALUE data) (114655.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_...