
March 6, 2011
8:35 p.m.
On 06.03.2011 19:32, Mart Sõmermaa wrote:
In Python the generalization is that since "xx".split(",") is ["xx"], and "x",split(",") is ["x"], it naturally follows that "".split(",") is [""].
That is one line of reasoning that emphasizes the "string-nature" of ''.
However, I myself, the Ruby folks and Nick would rather emphasize the "zero-element-nature" [1] of ''.
Both approaches are based on solid reasoning, the latter just happens to be more practical.
I think we haven't seen any proof of that (and no, the property of x.join(a).split(x) == a is not show me why it would be practical). Georg