From: Stephen Waits Date: 2006-03-18T01:53:16+09:00 Subject: Re: Card tricks with Ruby Matthew Moss wrote: > > [snip] Well, it's definitely one of the (very) few things that has bothered me about Ruby. For example: A Rubyist might argue that this is more error prone: for(int i=0;i<10;i++) than this: 10.times Which is a valid argument, and the result is elegant. And, we see stuff like this throughout Ruby. As Why's guide says often, read the code aloud. So yes, .. vs ... really bugs me. While they are convenient operators, I also see them as too error prone to fit in Ruby. As an earlier mentioned example, when I've taught Ruby, I always feel like I have to wave the red flags when I talk about ranges. > Unit testing could catch some errors, but I do agree if something > reasonably simple could replace it syntax-wise, it might be a tad > better. What that something simple is, I don't know... The simplest > solution would be to use mathematical notation, but that would be a > pita for the compiler to parse: [0..x) Yah, [x..y], [x..y), (x..y], (x..y) would be sweetness. It's slightly less error-prone IMO since it's following a common (math) notation. Still, maybe not perfect. Do any of the Ruby dinosaurs know if Matz has a stance on this issue? --Steve