36件ヒット
[1-36件を表示]
(0.055秒)
キーワード
-
rb
_ ary _ new3 (12) -
rb
_ ary _ store (12) -
rb
_ catch (12)
検索結果
先頭3件
-
VALUE rb
_ ary _ new3(long n , VALUE i0 , i1 , i2 , . . . ) (19.0) -
長さ n で要素に i0 i1 i2 …を格納した Ruby の配列を作成し返します。
...n で要素に i0 i1 i2 …を格納した
Ruby の配列を作成し返します。
対応するRubyコード
ary = Array[i0, i1, i2...] または
ary = [i0, i1, i2...]
使用例
VALUE ary;
int i[3] = { 1, 2, 3 };
ary = rb_ary_new3(3, INT2FIX(i[0]), INT2FIX(i[1]), INT2FIX(i[2]));... -
VALUE rb
_ catch(const char *tag , VALUE (*proc)() , VALUE data) (7.0) -
catch と同等の動作を実行します。
...oo_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_... -
void rb
_ ary _ store(VALUE ary , long idx , VALUE val) (7.0) -
配列 ary のインデックス idx に val を格納します。idx が範囲を越えるときは Ruby レベルと同じく自動的にサイズが拡張されます。
...を越えるときは
Ruby レベルと同じく自動的にサイズが拡張されます。
対応するRubyコード
ary[idx] = val
使用例
VALUE ary;
int idx;
int n[5] = { 1, 2, 3, 4, 5 };
ary = rb_ary_new();
for (idx=0; idx<5; idx++) rb_ary_store(ary, idx, INT2FIX(n[idx]));...