*aへの代入について

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

e$B8=:[email protected]$Ne(BLoneStar RubyConfe$B$Ge(BJames Edward G.
II(e$B"(e(B)e$B$+$i;Xe(B
e$BE&$5$l$?$N$G$9$,!"e(B

*a = [1,2,3]

e$B$,!"e(B1.8e$B$G$Oe(B[[1,2,3]]e$B!"e(B1.9e$B$G$Oe(B[1,2,3]e$B$K$J$j$^$9!#e(B

def m(*a)
p a
end
m([1,2,3]) # => [[1,2,3]]

e$B$+$i$NN`?d$G9T$/$H!"$3$l$Oe(B1.8e$B$NF0:n$NJ}$,[email protected]$,$"$k$h$&$Ke(B
e$B;W$&$N$G$9$,!"$3$NJQ99$K$O$J$K$+M}M3$,$"$C$?$h$&$J5$$b$7$^$9!#e(B
e$B$"$$$+$o$i$:5-21$,<e$/$F!M}M3$,;W$$=P$;$J$$$N$G$9$,!$3$NJQe(B
e$B99$NM}M3$r3P$($F$$$kJ}$O$$$i$C$7$c$$$^$;$s$+!)e(B

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

e$B"(e(B
e$BH$H1|$5$s$+$i$O!VF|K\$rBgJQ%(%s%8%g%$$7$?!#3'$5$s$K$h$m$7e(B e$B$/!W$H$N%a%C%;!<%8$r$"$:$+$j$^$7$?!#H$N%G%9%/%H%C%W$NJI;f$,e(B
e$BF|K\N99T$N$b$N$K$J$C$F$$$?$N$,0u>]E*$G$7$?!#$h$C$]$I3Z$7$+$Ce(B
e$B$?$i$7$$!#e(B

In article [email protected],
Yukihiro M. [email protected] writes:

m([1,2,3]) # => [[1,2,3]]

e$B$+$i$NN`?d$G9T$/$H!"$3$l$Oe(B1.8e$B$NF0:n$NJ}$,[email protected]$,$"$k$h$&$Ke(B
e$B;W$&$N$G$9$,!"$3$NJQ99$K$O$J$K$+M}M3$,$"$C$?$h$&$J5$$b$7$^$9!#e(B
e$B$"$$$+$o$i$:5-21$,<e$/$F!M}M3$,;W$$=P$;$J$$$N$G$9$,!$3$NJQe(B
e$B99$NM}M3$r3P$($F$$$kJ}$O$$$i$C$7$c$$$^$;$s$+!)e(B

[ruby-dev:38795] e$B$N:G8e$N$"$?$j$Ne(B

| e$BLdBj$O!":8JU!&1&[email protected]$1$,C1=c$G$J$$>l9g$G$"$k!#$?$H$($Pe(B x, y = u
| e$B$H$+e(B x = u e$B$H$+e(B x, = u e$B$H$+$G$"$k!#$3$N>l9g!":81&$NBP1~$,<[email protected]$G$J$$$N$G$Je(B
| e$B$s$i$+$N:Y9)$,I,MW$K$J$k!#e(B
|
| 1.9 e$B$K$
$1$k$3$3$G$N:Y9)$O4JC1$J$b$N$G$"$k!#:8JU!&1&JU$=$l$>$l$K$D$$$FC1=ce(B
| e$B$G$J$$>l9g$O3g8L$G3g$C$?$b$N$H$7$F2r<a$9$k$N$G$"$k!#$D$^$j!e(B(x, y) = u e$B$H$+e(B
| x = [*u] e$B$H$+e(B (x,) = u e$B$H$+$G$$k!#$3$l$K$h$jN>JU$,C1=c$K$J$k$N$GA4$F$NBeF~e(B
| e$B$OC1=cBeF~$K5"Ce$G$-$k$3$H$K$J$k!#e(B

e$B$,M}M3$G$9!#e(B

e$B$H$/$K6/$$M}M3$,$"$C$?46$8$O$7$^$;$s$M!#4JC1$G$"$k$3$H$/$i$$e(B
e$B$G$7$g$&$+!#e(B

| e$B$^$:!e(B1.9 e$B$G$OB?=EBeF~$H%V%m%C%/%Q%i%a!<%?$OJLJ*$G$$k!#0JA0$O$=$&$G$O$J$/!"e(B

e$B$H$$$&$3$H$b$"$C$F!"%a%=%C%I8F$S=P$7$HB?=EBeF~$N$"[email protected]$G$N0ce(B
e$B$$$O:Y$+$$$H$3$m$O5$$K$7$J$$!"$H$$$&[email protected]$C$?5$$,$7$^$9!#e(B

[email protected]!"$b$7%a%=%C%I8F$S=P$7$H$NN`?d$,8z$/$h$&$K$"$o$;$k$s$J$i!"e(B
e$B%a%=%C%I0z?t$8$c$J$/$F%V%m%C%/[email protected]$,Jx$l$9$.e(B
e$B$k$H;W$$$^$9$,!#e(B

e$BBeF~$N5sF0$r%V%m%C%/0z?t$K$"$o$;$?$H$-$K$I$N$/$i$$Hs8_49$K$Je(B
e$B$k$+$O!"$d$C$F$_$J$$$H$J$s$H$b!#BeF~$GEAC#$5$l$k>pJs$rB?CM$Ke(B
e$B$9$k$3$H$K$J$k$N$G!"[email protected]$5$s$KAjCL$9$k$H$3$m$+$i;O$a$k$s$Ge(B
e$B$9$+$M!#>o$KG[Ns$r:n$k$N$,[email protected]$H$9$l$P!#e(B

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

In message Re: [ruby-dev:39181] Re: *ae$B$X$NBeF~$K$D$$$Fe(B
on Fri, 28 Aug 2009 17:55:55 +0900, Tanaka A. [email protected]
writes:

|[ruby-dev:38795] e$B$N:G8e$N$"$?$j$Ne(B
|
|| e$BLdBj$O!":8JU!&1&[email protected]$1$,C1=c$G$J$$>l9g$G$"$k!#$?$H$($Pe(B x, y = u
|| e$B$H$+e(B x = u e$B$H$+e(B x, = u e$B$H$+$G$"$k!#$3$N>l9g!":81&$NBP1~$,<[email protected]$G$J$$$N$G$Je(B
|| e$B$s$i$+$N:Y9)$,I,MW$K$J$k!#e(B
||
|| 1.9 e$B$K$
$1$k$3$3$G$N:Y9)$O4JC1$J$b$N$G$"$k!#:8JU!&1&JU$=$l$>$l$K$D$$$FC1=ce(B
|| e$B$G$J$$>l9g$O3g8L$G3g$C$?$b$N$H$7$F2r<a$9$k$N$G$"$k!#$D$^$j!e(B(x, y) = u e$B$H$+e(B
|| x = [*u] e$B$H$+e(B (x,) = u e$B$H$+$G$$k!#$3$l$K$h$jN>JU$,C1=c$K$J$k$N$GA4$F$NBeF~e(B
|| e$B$OC1=cBeF~$K5"Ce$G$-$k$3$H$K$J$k!#e(B
|
|e$B$,M}M3$G$9!#e(B
|
|e$B$H$/$K6/$$M}M3$,$"$C$?46$8$O$7$^$;$s$M!#4JC1$G$"$k$3$H$/$i$$e(B
|e$B$G$7$g$&$+!#e(B

e$B$J$k$[$I!#$?$7$+$Ke(B *a = u e$B$re(B (a) = u
e$B$H9M$($?J}$,%k!<%k$,>/e(B
e$B$J$/$F$9$_$^$9$M!#e(B
a = u [email protected]$1$r<h$j=P$9$He(B a = [u]
e$B$NJ}$,$9$Ce(B
e$B$-$j$9$k$h$&$J5$$,$9$k$N$G$9$,!#e(B

e$B$I$&$b$"$j$,$H$&$4$6$$$^$7$?!#$3$l$O$3$N$^$^$K$7$F$*$3$&$H;We(B
e$B$$$^$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