[Bug #505] 1.upto 2 {|i| p i }

Bug #505: 1.upto 2 {|i| p i }
http://redmine.ruby-lang.org/issues/show/505

e$B5/I<<Te(B: Shyouhei U.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: High
e$BC4Ev<Te(B: Yukihiro M., e$B%+%F%4%je(B: core

e$B$$$D$N$^$K$+e(B1.upto 2 {|i| p i }e$B$,DL$j$^$9!#e(B

ruby -ve ‘1.upto 2 {|i| p i}’
ruby 1.9.0 (2008-08-27 revision 17576) [x86_64-linux]
1
2

1.8e$B$G$ONc30$G$9!#e(B

ruby -ve ‘1.upto 2 {|i| p i}’
ruby 1.8.7 (2008-08-12 revision 17572) [x86_64-linux]
-e:1: syntax error, unexpected ‘{’, expecting $end
1.upto 2 {|i| p i}
^

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

In message “Re: [ruby-dev:36008] [Bug #505] 1.upto 2 {|i| p i }”
on Wed, 27 Aug 2008 19:08:15 +0900, Shyouhei U.
[email protected] writes:

|Bug #505: 1.upto 2 {|i| p i }
|http://redmine.ruby-lang.org/issues/show/505
|
|e$B5/I<<Te(B: Shyouhei U.
|e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: High
|e$BC4Ev<Te(B: Yukihiro M., e$B%+%F%4%je(B: core
|
|e$B$$$D$N$^$K$+e(B1.upto 2 {|i| p i }e$B$,DL$j$^$9!#e(B
|
| ruby -ve ‘1.upto 2 {|i| p i}’
| ruby 1.9.0 (2008-08-27 revision 17576) [x86_64-linux]
| 1
| 2
|
|1.8e$B$G$ONc30$G$9!#e(B
|
| ruby -ve ‘1.upto 2 {|i| p i}’
| ruby 1.8.7 (2008-08-12 revision 17572) [x86_64-linux]
| -e:1: syntax error, unexpected ‘{’, expecting $end
| 1.upto 2 {|i| p i}

1.9e$B$G$N;EMMJQ99$G$9!#$h$j?F@Ze(B(or
e$BM>7W$J$*@$OCe(B)e$B$K%V%m%C%/$r2re(B
e$B<a$9$k$h$&$K$J$j$^$7$?!#e(B

e$BKNIt$G$9!#e(B

Yukihiro M. e$B$5$s$O=q$-$^$7$?e(B:

|e$BC4Ev<Te(B: Yukihiro M., e$B%+%F%4%je(B: core
| ruby -ve ‘1.upto 2 {|i| p i}’
| ruby 1.8.7 (2008-08-12 revision 17572) [x86_64-linux]
| -e:1: syntax error, unexpected ‘{’, expecting $end
| 1.upto 2 {|i| p i}

1.9e$B$G$N;EMMJQ99$G$9!#$h$j?F@Ze(B(or e$BM>7W$J$*@$OCe(B)e$B$K%V%m%C%/$r2re(B
e$B<a$9$k$h$&$K$J$j$^$7$?!#e(B

e$B$=$l$O$5$9$,$KM>7W$J$*@$OC$H$$$&$b$N$G$7$g$&!#e(B

% trunk/bin/ruby <<end
a = 0;
1.upto 2 {|i| a = i }
1.upto a {|i| p i }
end
-:3:in <main>': undefined methoda’ for main:Object (NoMethodError)

e$B$J$<e(B3e$B9TL$,DL$i$J$$$N$+$,@bL@$G$-$^$;$s!#e(B

e$BKNIt$G$9!#e(B

e$B$`$m$s!";d<+?H$OM}2r$7$F$$$^$9$,!"B>?M$K@bL@$,$G$-$J$$$H$$$&OC$G$9!#e(B

Yukihiro M. e$B$5$s$O=q$-$^$7$?e(B:

e$B$(!)e(B

a {|i| …} e$B$,%a%=%C%I8F$S=P$7$H$7$F2r<a$G$-$k$+$i!"$G@bL@$Ge(B
e$B$-$k$H;W$&$N$G$9$,!#0lJ}!"e(B2 {|i| …} e$B$O$I$&4hD%$C$F$b%a%=%Ce(B
e$B%I8F$S=P$7$H$O2r<a$G$-$^$;$s!#e(B

e$B$7$+$7e(Bae$B$H$$$&%a%=%C%I$O$I$3$K$bDj5A$5$l$F$$$J$$$N$G$9$+$i!"%a%=%C%I8F$Se(B
e$B=P$7$H$O2r<a$G$-$J$$$G$O$J$$$G$9$+!#e(B

e$B$b$A$m$s$3$3$G2r<a$9$k<gBN$O!V%W%m%0%i%^!W$G$"$C$F!V%Q!<%5!W$G$O$J$$e(B

e$B$?$V$s!"$3$3$O8@M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$OC$H$$$&$b$N$G$7$g$&!#e(B
|
|% trunk/bin/ruby <<end
| a = 0;
| 1.upto 2 {|i| a = i }
| 1.upto a {|i| p i }
|end
|-:3:in <main>': undefined method a’ for main:Object (NoMethodError)
|
|e$B$J$<e(B3e$B9TL$,DL$i$J$$$N$+$,@bL@$G$-$^$;$s!#e(B

e$B$(!)e(B

a {|i| …} e$B$,%a%=%C%I8F$S=P$7$H$7$F2r<a$G$-$k$+$i!"$G@bL@$Ge(B
e$B$-$k$H;W$&$N$G$9$,!#0lJ}!"e(B2 {|i| …} e$B$O$I$&4hD%$C$F$b%a%=%Ce(B
e$B%I8F$S=P$7$H$O2r<a$G$-$^$;$s!#e(B

e$B$?$V$s!“$3$3$O8@MUDL$j$G$O$J$/!”!V@bL@$G$-$^$;$s!W$H$$$&I=8=e(B
e$B$K$O$b$&$A$g$C$HJL$N0U?^$,4^$^$l$F$$$=$&$G$9$M!#$b$&$A$g$C$He(B
e$B9M$($F$_$^$9!#e(B

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

In message “Re: [ruby-dev:36020] Re: [Bug #505] 1.upto 2 {|i| p i }”
on Thu, 28 Aug 2008 01:00:56 +0900, Urabe S.
[email protected] writes:

|> a {|i| …} e$B$,%a%=%C%I8F$S=P$7$H$7$F2r<a$G$-$k$+$i!“$G@bL@$Ge(B
|> e$B$-$k$H;W$&$N$G$9$,!#0lJ}!“e(B2 {|i| …} e$B$O$I$&4hD%$C$F$b%a%=%Ce(B
|> e$B%I8F$S=P$7$H$O2r<a$G$-$^$;$s!#e(B
|
|e$B$7$+$7e(Bae$B$H$$$&%a%=%C%I$O$I$3$K$bDj5A$5$l$F$$$J$$$N$G$9$+$i!”%a%=%C%I8F$Se(B
|e$B=P$7$H$O2r<a$G$-$J$$$G$O$J$$$G$9$+!#e(B
|# e$B$b$A$m$s$3$3$G2r<a$9$k<gBN$O!V%W%m%0%i%^!W$G$”$C$F!V%Q!<%5!W$G$O$J$$e(B

e$B!V$I$3$K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$k$+JQ?t$G$”$k$+$G?6$kIq$$$,0[$J$k$3$He(B
e$B$O!“0lHL$Ne(B(Rubye$B$N;v>p$r$h$/CN$i$J$$e(B)e$B%f!<%6$K$H$C$F!”%a%s%?%ke(B
e$B%b%G%k$KH?$7$?$j!“:.Mp$r>7$$$?$j$9$k2DG=@-$,$”$k$H$$$&$3$H$Ge(B
e$B$9$M!#$=$l$O$=$l$G6Z$,DL$C$F$$$k$H;W$$$^$9!#e(B

e$BLdBj$O$I$A$i$KB7$($k$+$G$9$,!"$A$g$C$H9M$($5$;$F$/$@$5$$!#e(B

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

e$B%A%1%C%He(B #505 e$B$,99?7$5$l$^$7$?!#e(B (by Yukihiro M.)

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

Applied in changeset r19197.

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