From: Henrik Horneber Date: 2004-09-30T23:09:54+09:00 Subject: Re: Range syntax theory Austin Ziegler wrote: > On Thu, 30 Sep 2004 22:58:26 +0900, Henrik Horneber wrote: > >> From an intellectual point I sort of understand the '..' and '..' >>notation. What distracts me most, is the visual difference ... that the >>visually longer three dot form contains fewer elements than the shorter >>two dot form. >> >>(1..5).to_a >>=>[1,2,3,4,5] >>(1...5).to_a >>=>[1,2,3,4] > > > That's a dangerous consideration -- and not always true: > > irb(main):001:0> (1..5).include?(4.99) > => true > irb(main):002:0> (1...5).include?(4.99) > => true > irb(main):003:0> > > 1...5 doesn't include only the numbers 1, 2, 3, and 4 -- it contains > the infinities between the numbers, and the infinity between 4 and 5, > but not 5 itself. > > -austin Still, it's the 'larger' Range. Otherwise, good point, thx.