Splitter quiz / survey

Steven Schveighoffer schveiguy at yahoo.com
Mon Apr 27 07:02:41 PDT 2009


On Mon, 27 Apr 2009 09:43:40 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> Jason House wrote:
>> Before reading your post, I was going to say that I'd expect 4, would
>> accept 1, and consider 2 or 3 to be buggy! Notice how under your new
>> proposal everyone would still get the behavior wrong when reading the
>> code.
>
> everyone posting heavily in thiss group != everyone
>

Not that I care, because I don't use phobos, but you haven't really  
presented any good argument that your method is the most intuitive except:

1. Some example of badly written code that outputs extra spaces (I don't  
consider this to be common).
2. Perl does it that way.

The way I see it is: when I see a function named "splitter", I think the  
function splits a string based on identified token separators.  If you  
don't think of it that way, fine, you have every right to design Phobos  
however you want, despite the fact that 100% of respondants surveyed (so  
far) don't agree with your intuition.

I have never thought of a list of tokens with terminators vs. separators.   
I think what you should have as an option to split is to be able to ignore  
leading or trailing empty items, not "seperator is really terminator"  
enums, which would require a paragraph of explanation.

-Steve



More information about the Digitalmars-d mailing list