[Bug:trunk] Array#zip cannot accept enumerables as arguments


#1

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-cvs:28896] Ruby:r21678 (trunk): * array.c
(take_items), enum.c (enum_zip): tries to convert to”
on Jan.20,2009 06:47:50, removed_email_address@domain.invalid wrote:

nobu 2009-01-20 06:47:48 +0900 (Tue, 20 Jan 2009)

New Revision: 21678

http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21678

Log:
* array.c (take_items), enum.c (enum_zip): tries to convert to
array first. [ruby-core:21442]

e$B$?$V$s!“e(Barraye$B$X$NJQ49$r;n$7!”%@%a$J$ie(Beache$B$G2s$9!"$H$$$&$N$,0Ue(B
e$B?^$@$m$&$H;W$&$N$G$9$,!"e(BEnumerable#zipe$B$OBg>fIW$G$9$,e(BArray#zip
e$B$,$=$&$J$C$F$$$^$;$s!#e(B

Index: array.c

— array.c (revision 21699)
+++ array.c (working copy)
@@ -2209,7 +2209,7 @@ take_i(VALUE val, VALUE *args, int argc,
static VALUE
take_items(VALUE obj, long n)
{

  • VALUE result = to_ary(obj);
  • VALUE result = rb_check_array_type(obj);
    VALUE args[2];

    if (!NIL_P(result)) return rb_ary_subseq(result, 0, n);

e$B$=$l$G$O!#e(B


#2

e$B%A%1%C%He(B #1028 e$B$,99?7$5$l$^$7$?!#e(B (by Usaku NAKAMURA)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r21713.

http://redmine.ruby-lang.org/issues/show/1028