るりまサーチ

最速Rubyリファレンスマニュアル検索!
178件ヒット [1-100件を表示] (0.098秒)
トップページ > クエリ:t[x] > クエリ:catch[x]

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

Kernel.#catch {|tag| .... } -> object (24224.0)

Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。

...Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。

ブロックの実行中に tag と同一のオブジェクトを引数とする Kernel.#throw が行われた
場合は、その throw の第二引数を戻り値として、ブロック...
...、ブロックパラメータ tag に
渡されます。

@param tag タグとなる任意のオブジェクトです。
@return ブロックの返り値か、対応するthrowの第二引数を返り値として返します。

//emlist[例][ruby]{
result = catch do |tag|
for i in 1..2
for j...
...in 1..2
for k in 1..2
throw tag, k
end
end
end
end

p result #=> 1
//}

@see Kernel.#throw...

Kernel.#catch(tag) {|tag| .... } -> object (24224.0)

Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。

...Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。

ブロックの実行中に tag と同一のオブジェクトを引数とする Kernel.#throw が行われた
場合は、その throw の第二引数を戻り値として、ブロック...
...、ブロックパラメータ tag に
渡されます。

@param tag タグとなる任意のオブジェクトです。
@return ブロックの返り値か、対応するthrowの第二引数を返り値として返します。

//emlist[例][ruby]{
result = catch do |tag|
for i in 1..2
for j...
...in 1..2
for k in 1..2
throw tag, k
end
end
end
end

p result #=> 1
//}

@see Kernel.#throw...

static VALUE catch_i(ID tag) (12300.0)

static VALUE rb_f_catch(VALUE dmy, VALUE tag) (12300.0)

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

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

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

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

t
hrow が発生した場合はその値を返します。
t
hrow が発生しなかったとき...
...す。

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

static VALUE
foo_catch(VALUE obj)
{
return rb_catch("footag", foo_yield, INT2FIX(2));
}

static VALUE
foo_abort(VALUE obj)
{
return rb_throw("footag", Qnil);
}

void
Init_foo(void)...
...{
VALUE Foo = rb_define_class("Foo", rb_cObject);
rb_define_method(Foo, "catch", foo_catch, 0);
rb_define_method(Foo, "abort", foo_abort, 0);
}...

絞り込み条件を変える

static void catch_timer(int sig) (12200.0)

Kernel.#throw(tag, value = nil) -> () (6168.0)

Kernel.#catchとの組み合わせで大域脱出を行います。 throw は同じ tag を指定した catch のブロックの終わりまでジャンプします。

...Kernel.#catchとの組み合わせで大域脱出を行います。 throw
は同じ tag を指定した catch のブロックの終わりまでジャンプします。

t
hrow は探索時に呼び出しスタックをさかのぼるので、
ジャンプ先は同じメソッド内にあるとは限...
...同じ tag で待っている catch が存在しない場合は、例外で
スレッドが終了します。

同じ tag であるとは Object#object_id が同じであるという意味です。

@param tag catch の引数に対応する任意のオブジェクトです。
@param value catch...
...ArgumentError 同じ tag で待っている catch が存在しない場合に発生します。

//emlist[例][ruby]{
def foo
t
hrow :exit, 25
end

ret = catch(:exit) do
begin
foo
some_process() # 絶対に実行されない
10
ensure
puts "ensure"
end
end
puts ret
#=> ens...
...ncaughtThrowError 同じ tag で待っている catch が存在しない場合に発生します。

//emlist[例][ruby]{
def foo
t
hrow :exit, 25
end

ret = catch(:exit) do
begin
foo
some_process() # 絶対に実行されない
10
ensure
puts "ensure"
end
end
puts ret
#=>...

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

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

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

rb_catch も参照してください。...

RubyVM::InstructionSequence#to_a -> Array (6106.0)

self の情報を 14 要素の配列にして返します。

...ーマットを示す文字列。常に
"YARVInstructionSequence/SimpleDataFormat"。

: major_version

命令シーケンスのメジャーバージョン。

: minor_version

命令シーケンスのマイナーバージョン。

: format_type

データフォーマットを示す数値...
...、ブロックが取る引数の総数(1 つもない場合は 0)。

:local_size: ローカル変数の総数 + 1。

:stack_max: スタックの深さ。(SystemStackError を検出するために使用)

: #label

メソッド名、クラス名、モジュール名などで構成され...
...argc, [optional_arg_labels, ...],
splat_index, post_splat_argc, post_splat_index,
block_index, simple]

より詳細な情報については、vm_core.h を参照。

: catch_table

例外や制御構造のオペレータ(rescue、next、redo、break など)の一覧。

: bytecode...
<< 1 2 > >>