"abc"[3] returns ""

test-all e$B$,e(B
http://www.rubyist.net/~akr/chkbuild/debian-sarge/ruby-trunk/log/20060621T190802.txt.gz
e$B$H$$$&$h$&$Ke(B timeout e$B$9$k$N$GD4$Y$?$H$3$m!"e(B

% ./ruby -ve ‘p “abc”[3]’
ruby 1.9.0 (2006-06-21) [i686-linux]
“”

e$B$H$$$&$N$,LdBj$N$h$&$G$9!#e(B

% ruby -ve ‘p “abc”[3]’
ruby 1.9.0 (2006-06-08) [i686-linux]
nil

e$B$H$$$&$h$&$Ke(B nil e$B$,@[email protected]$H;W$$$^$9!#e(B

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

In message “Re: [ruby-dev:28786] “abc”[3] returns “””
on Thu, 22 Jun 2006 01:55:36 +0900, Tanaka A. [email protected]
writes:

|% ./ruby -ve ‘p “abc”[3]’
|ruby 1.9.0 (2006-06-21) [i686-linux]
|""
|
|e$B$H$$$&$N$,LdBj$N$h$&$G$9!#e(B
|
|% ruby -ve ‘p “abc”[3]’
|ruby 1.9.0 (2006-06-08) [i686-linux]
|nil
|
|e$B$H$$$&$h$&$Ke(B nil e$B$,@[email protected]$H;W$$$^$9!#e(B

e$B$U$`!"5sF0$,0c$C$F$$$^$9$M!#[email protected]!"e(B

“abc”[3,1] => “”

e$B$J$N$G!"$I$l$,[email protected]!W$+B(CG$G$-$J$$$N$,G:$^$7$$$H$3$m$G$9!#e(B
e$B$$$:$l$K$7$F$bB7$($?$[$&$,$h$5$=$&$G$9$,!#e(B

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

e$B$U$`!"5sF0$,0c$C$F$$$^$9$M!#[email protected]!"e(B

“abc”[3,1] => “”

e$B$J$N$G!"$I$l$,[email protected]!W$+B(CG$G$-$J$$$N$,G:$^$7$$$H$3$m$G$9!#e(B

“abc”[3,1] e$B$G<BAu$5$l$F$$$k$N$O$o$+$C$F$$$Fe(B

“abc”[beg,len]
beg: -4 -3 -2 -1 0 1 2 3 4
len
-1 nil nil nil nil nil nil nil nil
nil
0 nil “” “” “” “” “” “” “”
nil
1 nil “a” “b” “c” “a” “b” “c” “”
nil
2 nil “ab” “bc” “c” “ab” “bc” “c” “”
nil
3 nil “abc” “bc” “c” “abc” “bc” “c” “”
nil
4 nil “abc” “bc” “c” “abc” “bc” “c” “”
nil

e$B$H$$$&$h$&$JI=$^$G=q$$$F$7$^$C$?>e$G$$$&$N$G$9$,!"$d$C$Q$je(B
nil [email protected]$H;W$$$^$9!#e(B

e$B=DJ}8~$NJQ2=$r9M$($k$He(B “” e$B$H$$$&$N$b$?$7$+$K$"$j$&$k2r<a$J$Ne(B
e$B$G$9$,!"e(Blen=1 e$B8GDj$N2#J}8~$G$=$l$r0U<1$9$k$N$OL5M}$G!“e(Blen=3
e$B$N>[email protected]$1e(B “” e$B$H$$$&$N$Oe(B Array
e$B$H$NBP1~$r9M$($F$b$”$^$j$K0Ue(B
e$B30$9$.$^$9!#e(B

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

In message “Re: [ruby-dev:28788] Re: “abc”[3] returns “””
on Thu, 22 Jun 2006 02:09:48 +0900, Tanaka A. [email protected]
writes:

|> “abc”[3,1] => “”
|>
|> e$B$J$N$G!"$I$l$,[email protected]!W$+B(CG$G$-$J$$$N$,G:$^$7$$$H$3$m$G$9!#e(B
|
|“abc”[3,1] e$B$G<BAu$5$l$F$$$k$N$O$o$+$C$F$$$Fe(B
|
|“abc”[beg,len]
|beg: -4 -3 -2 -1 0 1 2 3 4
|len
|-1 nil nil nil nil nil nil nil nil nil
|0 nil “” “” “” “” “” “” “” nil
|1 nil “a” “b” “c” “a” “b” “c” “” nil
|2 nil “ab” “bc” “c” “ab” “bc” “c” “” nil
|3 nil “abc” “bc” “c” “abc” “bc” “c” “” nil
|4 nil “abc” “bc” “c” “abc” “bc” “c” “” nil
|
|e$B$H$$$&$h$&$JI=$^$G=q$$$F$7$^$C$?>e$G$$$&$N$G$9$,!"$d$C$Q$je(B
|nil [email protected]$H;W$$$^$9!#e(B
|
|e$B=DJ}8~$NJQ2=$r9M$($k$He(B “” e$B$H$$$&$N$b$?$7$+$K$"$j$&$k2r<a$J$Ne(B
|e$B$G$9$,!"e(Blen=1 e$B8GDj$N2#J}8~$G$=$l$r0U<1$9$k$N$OL5M}$G!“e(Blen=3
|e$B$N>[email protected]$1e(B “” e$B$H$$$&$N$Oe(B Array e$B$H$NBP1~$r9M$($F$b$”$^$j$K0Ue(B
|e$B30$9$.$^$9!#e(B

e$B$=$N8e!"[email protected]$K$J$j$^$7$?!#e(Bnile$B$rJV$9$3$H$K$7e(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