66件ヒット
[1-66件を表示]
(0.107秒)
検索結果
先頭5件
-
Kernel
. # catch {|tag| . . . . } -> object (27224.0) -
Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
...Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
ブロックの実行中に tag と同一のオブジェクトを引数とする Kernel.#throw が行われた
場合は、その throw の第二引数を戻り値として、ブロック......@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 (27224.0) -
Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
...Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
ブロックの実行中に tag と同一のオブジェクトを引数とする Kernel.#throw が行われた
場合は、その throw の第二引数を戻り値として、ブロック......@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... -
VALUE rb
_ catch(const char *tag , VALUE (*proc)() , VALUE data) (12546.0) -
catch と同等の動作を実行します。
...
catch と同等の動作を実行します。
まず proc に、yield された値と data を渡して実行します。
その途中で tag が throw されたら rb_catch 全体を終了します。
throw が発生した場合はその値を返します。
throw が発生しなかったとき......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 VALUE rb
_ f _ catch(VALUE dmy , VALUE tag) (12500.0) -
-
static VALUE catch
_ i(ID tag) (12300.0) -
-
debug (30.0)
-
Ruby デバッガです。Ruby スクリプトのソースコードデバッグに使用します。
...た、Emacs を使用したインタフェース rubydb3x.el が
https://github.com/ruby/elisp にあるので、活用してください。
=== 使い方
$ ruby -rdebug foo.rb
または、Emacs から
M-x load-library rubydb3x.el
M-x rubydb
=== デバッグコマンド
以下は、......た場合は現在実行中のファイルを指定した
ものと見倣されます。
このコマンドの省略形は b です。
: catch <an Exception>
例外が発生した時にデバッガを停止させるキャッチポイントを設定します。
引数を省略した......す。
このコマンドの省略形は cat です。
: watch <expression>
式 <expression> の値が変化したときに停止するウォッ
チポイントを設定します。
このコマンドの省略形は wat です。
: delete [nnn]
指定したブレークポイ...