Hi, At Mon, 3 Dec 2007 22:28:07 +0900, Yusuke ENDOH wrote in [ruby-core:13870]: > In addition, I implemented Voroztsov's idea in C. Please use as > a springboard for discussion. I've tried same approach last evening too, and it was very similar of course, including the name flatten_bang(). But I didn't tried the memo hash. > +static VALUE > +flatten(VALUE ary, int level) > +{ > + long i = 0; > + VALUE id, stack, memo, result, tmp; > + > + stack = rb_ary_new(); > + memo = rb_hash_new(); > + result = rb_ary_new(); > + rb_hash_aset(memo, rb_obj_id(ary), Qtrue); I guess it would be better use st_table and st_init_numtable() instead of Hash. Anyway, don't you have commit access yet? -- Nobu Nakada