On Wed, Aug 19, 2009 at 10:27 PM, Daniel DeLorme<dan-ml / dan42.com> wrote: > Yukihiro Matsumoto wrote: >> In message "Re: Bizarre Range behavior" >> ¨ΒΤυε¬ ±Έ Αυ²°°Ή ²±Ί³±Ί³Έ «°Ή°°¬ Δαξιεμ ΔεΜοςνΌδαξνμΐδαξ΄²®γονΎ >> writes: >> >> |That sounds nice and consistent, but why limit ourselves to numbers? >> | ("y".."aa").to_a >> |should then generate ["y", "z", "aa"] since that's what String#succ >> |generates. Sounds like this could snowball into a nightmare of >> |incompatible changes. >> >> Indeed. ¨Βθε ισσυισ τθατ ιτ§σ ξοεασιμω διστιξηυισθαβμχθετθε>> a sequence using #succ from a string reaches to another, or not. >> If there's affordable scheme to implement, I'd love to check in. > > While investigating this I came across: >>> "\0019".succ > => "\00110" > > I expected the result to be "\0020"; is that a bug? I don't think so, the octal escape is 'eating' the "1" and leaving "9" to succ to "10": $ ruby -v -e 'p "\0019".succ' ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] "\00110" $ ruby -v -e 'p "\019".succ' ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] "\00110" $ ruby -v -e 'p "\19".succ' ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] "\00110" $ ruby -v -e 'p "\1".succ' ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] "\002" $ ruby -v -e 'p "\119".succ' ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] "\t10" $ ruby -v -e 'p "\0119".succ' ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] "\t10" $ ruby -v -e 'p "\00119".succ' ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] "\00120" $ ruby -v -e "p '\0019'.succ" ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] "\\0020" $ ruby -v -e "p '\00 19'.succ" ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] "\\00 20" $ ruby -v -e 'p "\01 19".succ' ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] "\001 20"