From: Matthew Moss Date: 2006-03-18T02:09:20+09:00 Subject: Re: Card tricks with Ruby > > 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. > > Can you really stand to look at that? It gives me the same feeling as > putting my shoes on the wrong feet :-) As part-mathematician, I whole-heartedly say, "Yes!" It's a compact, consistent and clear representation of closed [ and open ( ends of ranges. As part-programmer, I recognize that it would be a bitch to parse, considering how often we make use of braces for all sorts of other needs (array access, expression grouping, function calls, etc, etc, etc). > I'm not sure what it is about the range operators that bothers you. > Are you finding it hard to remember which is which? My way of > remembering is: every range is the same width, in relation to the > operators. Since the ... operator is wider, the end-point gets pushed > outside the range: > > v v > a..b > a...b > ^ ^ This is basically how I now remember the difference between the two, and so having both operators doesn't bother me as much anymore. But I will admit that at first I could never remember the difference, and can see it as confusing to newbs.