From: Christian Szegedy Date: 2001-06-15T02:45:50+09:00 Subject: [ruby-talk:16476] C-extension question This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C0F50A.994B4960 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Matz wrote: > |Is it possible to pass over multiple arguments to the=20 > |block using rb_yield or is there some similarly simple > |method for this? > > invoke rb_yield() with array argument, for example, > > rb_yield(rb_ary_new3(3, INT2FIX(1), INT2FIX(2), INT2FIX(3))); Ok, but what if I would like to pass one variable which happens to be an = array? Does the compiler first look whether the block expects one or more = variables, and assumes that rb_yield is called with an array parameter in the latter = case? ------=_NextPart_000_0007_01C0F50A.994B4960 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Matz wrote:
> |Is = it possible=20 to pass over multiple arguments to the
> |block using rb_yield or is there some similarly=20 simple

> |method for = this?
>
> invoke rb_yield() with array argument, for=20 example,
>
> rb_yield(rb_ary_new3(3, = INT2FIX(1),=20 INT2FIX(2), INT2FIX(3)));
Ok, but what if I would like to pass one variable = which=20 happens to be an array?
 
Does the compiler first look whether the block = expects one or=20 more variables, and
assumes that rb_yield is called with an array=20 parameter in the latter case?

 
------=_NextPart_000_0007_01C0F50A.994B4960--