Summary: std.algorithm.find is too much hard to understand
--- Comment #0 from bearophile_h...@eml.cc 2010-03-10 06:23:10 PST ---
The find() of std.algorithm is too much hard to understand. I can't understand
how to use it and what it returns.
It's even hard to understand this in the docs page:
FindResult!(Range,Ranges) find(alias pred = "a == b", Range, Ranges...)(Range
haystack, Ranges needles);
struct BoyerMooreFinder(alias pred,Range);
BoyerMooreFinder!(binaryFun!(pred),Range) boyerMooreFinder(alias pred = "a ==
b", Range)(Range needle);
Such functions must be simple enough for normal people to use. If you need more
than 10 minutes to understand how to use something as simple as a "find", then
the library API is badly designed. It's not a limit of my brain, it's a problem
in the library design.
If I need to know that the substring "foo" is present in "abfoobar" in Python I
"foo" in "abfoobar"
This covers 85%+ of the cases in normal programs.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------