V
vsv
Could someone explain me, please, why Range with one element is
iterated inconsistently when this element is empty string:
$ irb --simple-prompt
## but:
Why to_a returns empty [] and each block never executed?
Is it bug or feature?
Any reasonable explanation?
thanks
Sergey
iterated inconsistently when this element is empty string:
$ irb --simple-prompt
=> [1]('a'..'a').to_a => ["a"]
(1..1).to_a
## but:
=> ""..""("".."").to_a => []
("".."").each{|s| puts 'Inside'}
Why to_a returns empty [] and each block never executed?
Is it bug or feature?
Any reasonable explanation?
thanks
Sergey