From: Andre Nathan Date: 2008-01-08T10:34:03+09:00 Subject: Re: Using "sort!" in a C extension (1.9 problem) On Tue, 2008-01-08 at 09:34 +0900, Yukihiro Matsumoto wrote: > In general, if you want to get multiple values from yield, you have to > use arguments added in 1.9: > > static VALUE > sort_i(VALUE a1, VALUE a2, int argc, VALUE *argv) > { > long v1 = FIX2LONG(RARRAY_PTR(argv[0])); > long v2 = FIX2LONG(RARRAY_PTR(argv[1])); > return LONG2FIX(v1 - v2); > } > > You may need to check argc if they are variable. Thanks Matz, Kubo helped me sorting this out. Is there any situation where a1 will be different from argv[0] other than the case Guy mentioned (argc == 0, and this argv[0] doesn't exist)? Best, Andre