Bug?: level argument of caller

[email protected]$G$9!%(B

$B!!(Bcaller(level) $B$N$h$&$K!$(Bcaller
$B%a%=%C%I$G$O2?CJ>e$+$i%P%C%/%H%l!<%9$r(B
$B;}$C$F$/$k$+!$$H$$$&$N$r(B level $B$H$$$&0z?t$G;XDj$G$-$^$9!%(B

$B!!$J$s$H$J$/!$(Blevel
$BJ,[email protected]$1%P%C%/%H%l!<%9$N>pJs$,8:$k$h$&$K;W$($k$N$G$9(B
$B$,!$$D$^$j(B

caller(0).size - level == caller(level).size

$B$H$J$j$=$&$J$b$s$G$9$,!$<B:]$O$=$&$J$j$^$;$s!%(B

$BNc!’(B

a = [1]
a.map{
a.map{
a.map{
10.times{|i|
p [i, caller(i).size]
}
}
}
}
#=>
ruby 2.0.0dev (2012-05-04 trunk 35535) [i386-mswin32_100]
[0, 9]
[1, 8]
[2, 8] # $B>e$HJQ$o$i$J$$(B
[3, 7]
[4, 6]
[5, 6] # $B>e$HJQ$o$i$J$$(B
[6, 5]
[7, 4]
[8, 4] # $B>e$HJQ$o$i$J$$(B
[9, 3]

$B!!M}M3$O!$(Blevel $B$r!$(BVM $B$N%9%?%C%/%U%l!<%$r(B level $B8D%9%-%C%W$9$k!$$H07$C(B $B$F$$$k$N$G$9$,!$%9%?%C%/%U%l!<%$N<oN`$K$h$C$F$O%P%C%/%H%l!<%9$K=P$F$3$J(B
$B$$>l9g$b$"$k$N$G!$$=$N%9%-%C%W$5$l$?J,$r(B level
$B$G%9%-%C%W$9$k?t$K$$$l$F(B
$B$$$k$+$i!$$H$$$&M}M3$G$9!%(B

$B!!(B1.8 [email protected]$H4|BTDL$j!J!)!KF0$-$^$9!%(B

#=> ruby 1.8.7 (2012-02-08 patchlevel 358) [i386-cygwin]
[0, 9]
[1, 8]
[2, 7]
[3, 6]
[4, 5]
[5, 4]
[6, 3]
[7, 2]
[8, 1]
[9, 0]

$B!!$H$$$&$o$1$G!$%P%0$J5$$b$9$k$s$G$9$,!$$I$&$7$?$b$s$G$7$g$&!%$3$l$^$G6l(B
$B>p$bMh$F$J$$$+$i!$$I$&$G$b$$$$$h$&$J5$$b$9$k$s$G$9$,!%(B2.0
$B$+$iD>$7$^$9!)(B

caller$B$N0z?t$O(B0$B$H(B1$B0J30;H$C$F$k$N8+$?$3$H$J$$$N$G!"$I$&$G$b$$$$$s$8$c$J$$$G$7$g$&$+!#(B
[email protected]$7$F$7$^$&$N$K0lI<!#(B

2012/5/23 Urabe S. [email protected]:

caller$B$N0z?t$O(B0$B$H(B1$B0J30;H$C$F$k$N8+$?$3$H$J$$$N$G!"$I$&$G$b$$$$$s$8$c$J$$$G$7$g$&$+!#(B

[email protected]$7$F$7$^$&$N$K0lI<!#(B

$BF1$8$/!#(B

$B$"$+$i$5$^$K$*$+$7$$E[$K$?$$$7$F!"%P%0$K0MB8$7$F$k$d$D$,!&!&!&$H$+9M$(=P$9$H%-%j$,$J$$$G$9$h!#$3$&$$$&$N$O%.%[email protected]$o$l$F$+$i9M$($k$7$+$J$$$H;W$&(B

$B!!$40U8+$"$j$,$H$&$4$6$$$^$9!%[email protected]$7$^$9!%(B