New block parameter rule

[email protected]$G$9!#e(B

e$B!!e(B|v| e$B$Oe(B |v,|
e$B$N0UL#$H$7$F07$&$H$$$&$h$&$K!"%V%m%C%/%Q%i%a!<%?e(B
e$B$N%k!<%k$rJQ99$7$^$7$?!#e(B

e$B!!$D$^$j!"e(Bdef m; yield 1, 2; end; m{|v| p v} e$B$Oe(B [1, 2]
e$B$G$O$Je(B
e$B$/!"e(B1 e$B$rI=<($7$^$9!#e(B

http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_iterator.rb?r1=12544&r2=12543
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_assignment.rb?r1=12544&r2=12543
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_yield.rb?r1=12544&r2=12543
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_basicinstructions.rb?r1=12544&r2=12543

e$B!!$3$l$KH<$$!"e(Btest
e$B$r2~B$$7$^$7$?$,!“K\Ev$K$3$N2~JQ$,@5$7$$$+e(B
e$B$I$&$+!”[email protected]$1$J$$$G$7$g$&$+!#e(B

def f; yield(*[[]]); end; f {|a,b,*c| assert_equal([[],nil,[]], [a,b,c])}; undef f

e$B!!$3$l$J$s$+$O!"$?$V$se(B [nil, nil, []] [email protected]$m$&$H;W$C$FJQ99$7e(B
e$B$A$c$C$?$s$G$9$,!"@5$7$+$C$?$G$9$+!)e(B

In article [email protected],
SASADA Koichi [email protected] writes:

e$B!!$3$l$KH<$$!"e(Btest e$B$r2~B$$7$^$7$?$,!“K\Ev$K$3$N2~JQ$,@5$7$$$+e(B
e$B$I$&$+!”[email protected]$1$J$$$G$7$g$&$+!#e(B

Hash#each e$B$Oe(B 2e$BMWAG$NG[Ns$r$R$H$D$NCM$H$7$Fe(B yield
e$B$9$k$h$&$Ke(B
e$B$9$k$H$$$&$N$,e(B [ruby-dev:29616] e$B$NDs0F$J$N$G!"e(BHash#each
e$B$^$oe(B
e$B$j$N%F%9%HJQ99$O;d$N0U?^$H$O0c$$$^$9!#e(B

def f; yield(*[[]]); end; f {|a,b,*c| assert_equal([[],nil,[]], [a,b,c])}; undef f

e$B!!$3$l$J$s$+$O!"$?$V$se(B [nil, nil, []] [email protected]$m$&$H;W$C$FJQ99$7e(B
e$B$A$c$C$?$s$G$9$,!"@5$7$+$C$?$G$9$+!)e(B

[ruby-dev:29616] e$B$G$b$=$&JQ$($F$"$j$^$9$h$M!#e(B

[email protected]$G$9!#e(B

Tanaka A. wrote:

Hash#each e$B$Oe(B 2e$BMWAG$NG[Ns$r$R$H$D$NCM$H$7$Fe(B yield e$B$9$k$h$&$Ke(B
e$B$9$k$H$$$&$N$,e(B [ruby-dev:29616] e$B$NDs0F$J$N$G!"e(BHash#each e$B$^$oe(B
e$B$j$N%F%9%HJQ99$O;d$N0U?^$H$O0c$$$^$9!#e(B

e$B!!e(Br12546 e$B$NJQ99$GBg>fIW$G$9$+!#e(B

def f; yield(*[[]]); end; f {|a,b,*c| assert_equal([[],nil,[]], [a,b,c])}; undef f

e$B!!$3$l$J$s$+$O!"$?$V$se(B [nil, nil, []] [email protected]$m$&$H;W$C$FJQ99$7e(B
e$B$A$c$C$?$s$G$9$,!"@5$7$+$C$?$G$9$+!)e(B

[ruby-dev:29616] e$B$G$b$=$&JQ$($F$"$j$^$9$h$M!#e(B

e$B!!$$!#$J$k$[$I!#e(B

In article [email protected],
SASADA Koichi [email protected] writes:

e$B!!e(Br12546 e$B$NJQ99$GBg>fIW$G$9$+!#e(B

test/ruby/test_yield.rb e$B$Ge(B k e$B$re(B kv
e$B$KLa$7K:$l$F$^$9$+$M!#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