[ruby-talk:02581] Re: String.succ

From: Reimer Behrends <behrends@...>
Date: 2000-04-26 08:05:41 UTC
List: ruby-talk #2581
On Wed, Apr 26, 2000 at 02:43:49AM -0500, schneik@us.ibm.com wrote:
> Matz writes:
[...]
> # Ok, I define as following:
> #
> #   "".succ == ""
> #   "\377".succ == "\001\000"
> 
> Maybe I missed something, but for simplicity, consistency,
> least surprise, ease of remembering, why not:
> 
>     "".succ == "\000"

That should probably be

	"".succ == "\001"

given that the implicit assumption seems to be that the string is padded
with an infinite number of zeros to the left for purposes of finding the
successor.

				Reimer Behrends

In This Thread

Prev Next