search/has_value defies logic :-)
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=1065
Reported by @marcus
The search and has_value functions generally takes the syntax
f(collection, element)
and looks for the element in the collection of elements. In the case where the first argument is a string however, passing a character ('x') for the second argument gives an error. This is obviously a bug, since characters are undoubtedly the elements of strings.
In the case of has_value, the glitch is especially clear if you consider the semantics of the coupled function has_index:
has_index("foo", 1) is true, since 1 is in indices("foo"). Therefore, has_value("foo", 'o') should be true, since 'o' is in values("foo").