Array#flatten の仕様変更?

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

1.9 e$B$Ne(B Array#flatten e$B$K$$$$F!$G[NsFb$N%%V%8%%/%H$Ne(B
to_ary e$B%a%=%C%I8F$S=P$7$KBP$9$k5sF0$,860x$G%(%i!<$H$J$k>r7o$,e(B
NameError e$B$+$ie(B NoMethodError e$B$KJQ99$K$J$C$?$h$&$G$9$,!$e(B
e$B$3$l$O;EMMJQ99$G$7$g$&$+!)e(B

e$B$3$l$,860x$Ge(B Ruby/Tk e$B$,F0$+$J$/$J$C$F$$$k$N$G$9$,!$e(B
e$BLdBj$N2U=j$re(B NameError e$B$+$ie(B NoMethodError e$B$KJQ99$9$k$He(B
e$B;EMMJQ99$K$J$k$N$G$I$&$7$h$&$+$HLB$C$F$$$^$9!%e(B
e$BJQ99$7$F$b==CfH,6e$O!J6eJ,6eNR$O!)!KLdBj$J$$$H$O;W$&$N$G$9$,!$e(B
e$BG0$N$?$a8x<0$N;EMMJQ99$+$I$&$+$r3NG$5$;$F$/[email protected]$5$$!%e(B

Ruby/Tk e$B$G$O!$e(Bwidget e$B%*%V%8%%/%[email protected]@_Dje(B (cget

e$BEye(B) e$B$K$*$$$F!$e(B

[email protected]>$KBP$7$F$Oe(B NameError e$B$GJV$7$F$$$^$9!%e(B

e$B$=$l$K9g$o$;$F!$e(Bmethod_missing [email protected]>%a%=%C%I$be(B

e$BCN$i$J$$$b$Ne(B (e$B:#2s$N>l9g$Oe(B to_ary) e$B$KBP$7$Fe(B

NameError e$B$rJV$9$h$&$K$7$F$$$^$7$?!%e(B

e$B!V$J$<e(B NameError e$B$+!)!W$K$D$$$F$O!$e(B

e$B$I$&$$$&7P0^[email protected]$C$?$+5-21$K$"$j$^$;$s!%e(B

e$B8D?ME*$K$Oe(B to_ary e$B$G%(%i!<$J$iC1$K$=$N$^$^$Ne(B object
[email protected]$1$G$be(B
e$B$$$$$h$&$J5$$b$9$k$N$G$9$,!$$=$l$O$5$9$,$KL5Cc$G$9$+$M!%e(B(^_^)

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message Re: [ruby-dev:40268] Array#flatten e$B$N;EMMJQ99!)e(B
on Sun, 31 Jan 2010 09:48:36 +0900, Hidetoshi NAGAI
[email protected] writes:

|1.9 e$B$Ne(B Array#flatten e$B$K$$$$F!$G[NsFb$N%%V%8%%/%H$Ne(B
|to_ary e$B%a%=%C%I8F$S=P$7$KBP$9$k5sF0$,860x$G%(%i!<$H$J$k>r7o$,e(B
|NameError e$B$+$ie(B NoMethodError e$B$KJQ99$K$J$C$?$h$&$G$9$,!$e(B
|e$B$3$l$O;EMMJQ99$G$7$g$&$+!)e(B

e$B$9$_$^$;$s!"@5D>$J$H$3$m!Ve(Bflattene$B$K$$$$F!"G[NsFb$N%%V%8%%/e(B
e$B%H$Ne(B to_ary e$B%a%=%C%I8F$S=P$7$KBP$9$k5sF0$,860x$G%(%i!<$H$J$ke(B
e$B>r7o!W$H$$$&$N$,!"$J$K$r0UL#$9$k$N$+$h$/$o$+$i$J$$$N$G$9$,!#e(B
1.8e$B0JA0$Oe(Bto_arye$B$r;}$C$F$$$k$+$I$&$+$re(Brespond_to?e$B$GH=Dj$7$F$$e(B
e$B$?$N$r!"e(B1.9e$B$G$OD>@\8F$S=P$9$h$&$K$7$?$3$H$H4X78$7$F$$$k$H;W$$e(B
e$B$^$9$,!#e(B

|e$B$3$l$,860x$Ge(B Ruby/Tk e$B$,F0$+$J$/$J$C$F$$$k$N$G$9$,!$e(B
|e$BLdBj$N2U=j$re(B NameError e$B$+$ie(B NoMethodError e$B$KJQ99$9$k$He(B
|e$B;EMMJQ99$K$J$k$N$G$I$&$7$h$&$+$HLB$C$F$$$^$9!%e(B

NameErrore$B$He(BNoMethodErrore$B$O7Q>54X78$K$"$k$N$G!"$"$^$jLdBj$O5/e(B
e$B$-$J$$$H;W$C$F$$$?$N$G$9$,!#6qBNE*$K$I$&F0$+$J$/$J$C$F$$$k$+!e(B
e$B$I$N$h$&$KJQ99$7$h$&$H;W$C$F$$$k$+!$J$I!J9$+$;[email protected]$1$ke(B
e$B$H%%I%P%$%9$7$h$&$,$"$k$H;W$$$^$9!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: Yukihiro M. [email protected]
Subject: [ruby-dev:40285] Re: Array#flatten e$B$N;EMMJQ99!)e(B
Date: Mon, 1 Feb 2010 17:03:05 +0900
Message-ID: [email protected]

|1.9 e$B$Ne(B Array#flatten e$B$K$$$$F!$G[NsFb$N%%V%8%%/%H$Ne(B
|to_ary e$B%a%=%C%I8F$S=P$7$KBP$9$k5sF0$,860x$G%(%i!<$H$J$k>r7o$,e(B
|NameError e$B$+$ie(B NoMethodError e$B$KJQ99$K$J$C$?$h$&$G$9$,!$e(B
|e$B$3$l$O;EMMJQ99$G$7$g$&$+!)e(B
e$B$9$_$^$;$s!"@5D>$J$H$3$m!Ve(Bflattene$B$K$$$$F!"G[NsFb$N%%V%8%%/e(B
e$B%H$Ne(B to_ary e$B%a%=%C%I8F$S=P$7$KBP$9$k5sF0$,860x$G%(%i!<$H$J$ke(B
e$B>r7o!W$H$$$&$N$,!"$J$K$r0UL#$9$k$N$+$h$/$o$+$i$J$$$N$G$9$,!#e(B

[email protected]@$,0-$/$F$9$_$^$;$s!%e(B

1.8e$B0JA0$Oe(Bto_arye$B$r;}$C$F$$$k$+$I$&$+$re(Brespond_to?e$B$GH=Dj$7$F$$e(B
e$B$?$N$r!"e(B1.9e$B$G$OD>@\8F$S=P$9$h$&$K$7$?$3$H$H4X78$7$F$$$k$H;W$$e(B
e$B$^$9$,!#e(B

e$B<!$NNc$re(B 1.8 e$B$He(B 1.9 e$B$H$G<B9T$9$k$H!$7k2L$,0[$J$j$^$9!%e(B
to_str e$B$G$bF1MM$N$3$H$,@8$8$k$N$G!$$D$$$G$K4^$a$F$$$^$9!%e(B

obj1 = Object.new
p [1,obj1].flatten #=> no error

obj2 = Object.new
def obj2.method_missing(id,*args)
raise NoMethodError, 2 unknown #{id}
end
begin
p [2,obj2].flatten #=> error!
rescue => e
p e
end

obj3 = Object.new
def obj3.method_missing(id,*args)
raise NameError, 3 unknown #{id}
end
begin
p [3,obj3].flatten #=> [1.8] [3,obj3] ; [1.9] error!
rescue => e
p e
end

[obj1, obj2, obj3].each{|obj|
begin
case obj
when /^xxx/
p [xxx, obj]
else
p [else, obj]
end
rescue => e
p e
end
}

<< 1.8 >>-------------------------
[1, #Object:0xb7dddf6c]
[2, #Object:0xb7dddeb8]
[3, #Object:0xb7ddddf0]
[else, #Object:0xb7dddf6c]
[else, #Object:0xb7dddeb8]
[else, #Object:0xb7ddddf0]

<< 1.9 >>-------------------------
[1, #Object:0x8201dd8]
[2, #Object:0x8201d10]
#<NameError: 3 unknown to_ary>
[else, #Object:0x8201dd8]
[else, #Object:0x8201d10]
#<NameError: 3 unknown to_str>

|e$B$3$l$,860x$Ge(B Ruby/Tk e$B$,F0$+$J$/$J$C$F$$$k$N$G$9$,!$e(B
|e$BLdBj$N2U=j$re(B NameError e$B$+$ie(B NoMethodError e$B$KJQ99$9$k$He(B
|e$B;EMMJQ99$K$J$k$N$G$I$&$7$h$&$+$HLB$C$F$$$^$9!%e(B

NameErrore$B$He(BNoMethodErrore$B$O7Q>54X78$K$"$k$N$G!"$"$^$jLdBj$O5/e(B
e$B$-$J$$$H;W$C$F$$$?$N$G$9$,!#6qBNE*$K$I$&F0$+$J$/$J$C$F$$$k$+!e(B
e$B$I$N$h$&$KJQ99$7$h$&$H;W$C$F$$$k$+!$J$I!J9$+$;[email protected]$1$ke(B
e$B$H%%I%P%$%9$7$h$&$,$"$k$H;W$$$^$9!#e(B

e$BF0$+$J$/$J$C$F$$$?$N$O!$e(Bflatten e$B$,8F$P$l$kG[Ns$NCf$Ke(B
widget object e$B$,4^$^$l$F$$$k>l9g$G!$e(BNameError
e$B$G;_$^$C$F$^$7$?!%e(B

widget object e$B$G$O!$CN$i$J$$%a%=%C%I$KBP$7$F$Oe(B

[email protected]$N;2>He(B/e$BA`:n%a%=%C%I$r8F$$&$H$7$F$$$k$H2r<a$7$F!$e(B

e$BL>A0$N6A$-$Ge(B NameError

e$B$rJV$9$h$&[email protected]$H;W$$$^$9!%e(B

e$BJQ99$K$D$$$F$O!$e(Bwidget object e$B$Ne(B method_missing
e$B$K$$$$Fe(B
to_ary e$B$He(B to_str e$B$N>l9g$Oe(B NoMethodError
e$B$H$J$k$h$&$KJQ99$7$^$7$?!%e(B
e$B;EMMJQ99$K$O$J$k$N$G$9$,!$$3$NDxEY$G$"$l$P!$e(B
e$B$
[email protected]$m$&$H;W$$$^$9$N$G!$e(B
ext/tk/lib/tk.rb e$B$Ne(B commit e$B$r:Q$^$;$F$7$^$$$^$7$?!%e(B

e$B$*A{$,$;$7$F$9$_$^$;$s$G$7$?!%e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message Re: [ruby-dev:40292] Re: Array#flatten e$B$N;EMMJQ99!)e(B
on Tue, 2 Feb 2010 08:23:40 +0900, Hidetoshi NAGAI
[email protected] writes:

|e$BF0$+$J$/$J$C$F$$$?$N$O!$e(Bflatten e$B$,8F$P$l$kG[Ns$NCf$Ke(B
|widget object e$B$,4^$^$l$F$$$k>l9g$G!$e(BNameError e$B$G;_$^$C$F$^$7$?!%e(B

e$B$J$k$[$I!#e(BNoMethodErrore$B$7$+JaB*$7$F$$$^$;$s$+$i$M!#e(B

|# widget object e$B$G$O!$CN$i$J$$%a%=%C%I$KBP$7$F$Oe(B
|# [email protected]$N;2>He(B/e$BA`:n%a%=%C%I$r8F$$&$H$7$F$$$k$H2r<a$7$F!$e(B
|# e$BL>A0$N6A$-$Ge(B NameError e$B$rJV$9$h$&[email protected]$H;W$$$^$9!%e(B
|
|e$BJQ99$K$D$$$F$O!$e(Bwidget object e$B$Ne(B method_missing e$B$K$$$$Fe(B
|to_ary e$B$He(B to_str e$B$N>l9g$Oe(B NoMethodError e$B$H$J$k$h$&$KJQ99$7$^$7$?!%e(B
|e$B;EMMJQ99$K$O$J$k$N$G$9$,!$$3$NDxEY$G$"$l$P!$e(B
|e$B$
[email protected]$m$&$H;W$$$^$9$N$G!$e(B
|ext/tk/lib/tk.rb e$B$Ne(B commit e$B$r:Q$^$;$F$7$^$$$^$7$?!%e(B
|
|e$B$*A{$,$;$7$F$9$_$^$;$s$G$7$?!%e(B

e$B$$$(!"$=$l$O9=$$$^$;$s$,!e(Bto_stre$B$He(Bto_arye$B$K8B$i$:!!VCN$i$J$$e(B
e$B%a%=%C%I!W$KBP$7$F$O!">o$Ke(BNoMethodErrore$B$rJV$9$Y$-$J$s$8$c$J$$e(B
e$B$G$7$g$&$+!#DL>o$N%%V%8%%/%H$N?6$kIq$$$K$"$o$;$F$$$$?J}$,e(B
e$BLdBj$,>/$J$$$H;W$$$^$9!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs