[#3986] Re: Principle of least effort -- another Ruby virtue. — Andrew Hunt <andy@...>

> Principle of Least Effort.

14 messages 2000/07/14

[#4043] What are you using Ruby for? — Dave Thomas <Dave@...>

16 messages 2000/07/16

[#4139] Facilitating Ruby self-propagation with the rig-it autopolymorph application. — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/07/20

[ruby-talk:04144] String range inconsistence

From: "Sergey Abel" <abel_sm@...>
Date: 2000-07-20 10:06:26 UTC
List: ruby-talk #4144
Hi,

"z".succ == "aa", but "z" > "aa".
As a consequence, ("z".."aa").size == 0 instead of 2.
(Same with upto method, for that matter.)

The reason is clear: it's "unnatural" succ definition.
(BTW, "\000".succ == "\001\001". Wow.)

IMHO, this has been conceived as the method for "plain letters",
not for arbitrary strings. If so, isn't this a subject to discuss?

Does the language need a special subclass (encoding-dependent?)
for such strings and/or methods?
How to cope with punctuation, e.g. should we expect "a:".succ == "b:"?

Sergey Abel




In This Thread

Prev Next