Comment #0 by bearophile_hugs — 2011-04-12T17:18:57Z
From benchmarks I've seen that std.array.splitter() is often more efficient than std.array.split(), probably because splitter doesn't allocate memory for the array.
Python programmers (and maybe other programmers) are used to use split(), despite often splitter() is enough for their purposes.
The "splitter" name is longer than "split", but it's better to suggest D programmers (and D programmes coming from Python) to use splitter() on default instead of split().
So I suggest to give a shorter name to the lazy generator, and a longer name to the function that returns an array. This is also more aligned to the naming in std.algorithm where the short function names (like map and filter) are for the lazy versions.
In bug 5756 I have suggested to add amap/afilter that approximately mean array(map())/array(filter()). So the lazy splitter may be named just "split" and the one that generates an array (that's similar to array(split())) may be named "asplit" (if you want the prefix "a" may also be seen as the prefix of the "aeger" word, instead of "array").
So my renaming suggestions are:
"split()" ==> "asplit()"
"splitter()" ==> "split()"
Comment #1 by lt.infiltrator — 2014-03-19T17:25:42Z
Has there been any discussion on this elsewhere?
Is this one of those shunned breaking changes? (If so, use of splitter could do the three-stage warn/depr/err process.)
Comment #2 by bearophile_hugs — 2014-03-19T18:00:38Z
(In reply to comment #1)
> Has there been any discussion on this elsewhere?
Probably not, as many other things in Bugzilla.
> Is this one of those shunned breaking changes?
Probably yes.
Comment #3 by lt.infiltrator — 2015-12-03T01:48:43Z
If we were to do this, then the same should be done for join and joiner too. So that we end up with join => ejoin[0], split => esplit[0], and joiner => join and splitter => split.
The problem with this is of course that it would break existing code, so I highly doubt that it would happen.
I'm CCing Andrei and Walter on this so that they can make a definitive decision one way or the other.
[0] e for eager. You said "a for aeger" before; but I think that was just a spelling error?