[ruby-trunk - Feature #2323] "Z".."Z".succが空

Issue #2323 has been updated by Motohiro KOSAKI.

これは勝手には閉じられないなあ。どこかで集中して議論するタイミングが必要かも

Feature #2323: “Z”…“Z”.succが空
https://bugs.ruby-lang.org/issues/2323

Author: Hiro A.
Status: Assigned
Priority: Low
Assignee: Yukihiro M.
Category: core
Target version: 2.0.0

=begin
surfboard:~$ ruby1.9 -v; ruby1.9 -e ‘p (“Z”…“Z”.succ); p
(“Z”…“Z”.succ).to_a’
ruby 1.9.2dev (2009-11-02 trunk 25625) [x86_64-darwin10.0.0]
“Z”…“AA”
[]

“Z”.succではなくてもうちょっと”離れた”ヤツをRangeの終わりとして指定すると"AA"はしっかりと入っています。

surfboard:~$ ruby1.9 -e ‘p (“Z”…“ZA”).include? “Z”.succ’
true

でも半端な”離れ”方ではいけません。

surfboard:~$ ruby1.9 -e ‘p (“Z”…“CA”).include? “Z”.succ’
false

to_aを介しても同様です。

surfboard:~$ ruby1.9 -e ‘p (“Z”…“ZA”).to_a.include? “Z”.succ’
true
surfboard:~$ ruby1.9 -e ‘p (“Z”…“CA”).to_a.include? “Z”.succ’
false
=end

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