D
Daniel Berger
Hi all,
Say I have an array VALUE. How would I splat that value within a C
extension?
/* test.c */
VALUE ary1 = rb_ary_new();
VALUE ary2 = rb_ary_new();
rb_ary_push(ary2, rb_str_new2("hello"));
rb_ary_push(ary1, ary2); /* Wrong - ary1 is now [["hello"]]
/* end test.c */
I know in this particular case I could use rb_ary_concat(), but I was
just wondering in general how you do this.
Thanks,
Dan
Say I have an array VALUE. How would I splat that value within a C
extension?
/* test.c */
VALUE ary1 = rb_ary_new();
VALUE ary2 = rb_ary_new();
rb_ary_push(ary2, rb_str_new2("hello"));
rb_ary_push(ary1, ary2); /* Wrong - ary1 is now [["hello"]]
/* end test.c */
I know in this particular case I could use rb_ary_concat(), but I was
just wondering in general how you do this.
Thanks,
Dan