Summary: splitter and split names
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos

--- Comment #0 from 2011-04-12 17:18:57 PDT ---
>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()"

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to