From: Sean Chittenden Date: 2002-04-24T16:14:20+09:00 Subject: Re: Numberic#prev > |> I'm not sure how much useful it is. And I'm (little bit) afraid > |> of it might cause request for String#prev, which is way difficult > |> to define. > | > |It's only as useful as Integer#succ, which, proves to be useful > |when dealing with simple stacks and counters used outside of the > |range class. > > Hmm, ascending order vs descending order... > > |I agree with the preceding post: > | > |aString.succ.prev = aString.prev.succ = aString > > Unfortunately String#succ is not reversible operation since it's not > one-to-one relation. I never understood why the last character in the string wasn't converted to an int, then ++. If the final char's value was greater than 255, then roll over the remainder in strlen(cur_pos - 1).... greater than 255... that begs: why isn't there a class called "Character" that handles unicode. Right now String#succ seems horribly English centric. If it's a Spanish locale, 'o'.succ doesn't return "o'" (can't produce the o w/ the accent on top at the moment, it's HTML escape code is ó though ::grin::). How's this: apply patch, worry about nagging users later. There might not be any need for String#prev... -sc -- Sean Chittenden