On Oct 12, 2007, at 9:40 AM, Brian Adkins wrote: > > Actually, what you want is simply N. It's a nonsensical request from a > troll. Using max, end, last, etc. to find the end of the range is > ridiculous since you must know the end of the range to define the > range! that is not true. any object can be used in a range in ruby. it only must respond to #succ. it's quite possible to declare classes that worked like so class TimeOfDay end noon_today = TimeOfDay 12, :today noon_morrow = TimeOfDay 12, :tomorrow noon_to_noon = noon_today ... noon_tomorrow p noon_to_noon.max #=> TimeOfDay< @hour=24, @minute=0, @second=0 > in other words to construct a cycle or other sequence using a range. and, more simply -1 .. -4 while quite valid, requires some thought as to which end is the maximum. with pure numbers you'd say -1 (the first) but, if those were like so Depth(-1) .. Depth(-4) that the Depth class semantics may dictate that Depth(-4) is in fact the max. regards. a @ http://codeforpeople.com/ -- it is not enough to be compassionate. you must act. h.h. the 14th dalai lama