Richard,

I am afraid I started this calling of you Howard. I corrected my mistake shortly after but unforunately is seems to have stuck in others members head. I am sorry.

Brian,

I have been busy lately & this is a complex subject so I have no time to develop a respond to your comments.

I don't think I expressed myself very well. I believe this discussion is about a fundamental paradox. I do believe it closely parallels Bertrand Russell's paradox. The basic paradox is an infinite number of nothings exist in everything. Like Russell's paradox, it can not be resolved unless you apply extra constraints or axioms to your logic system.

You say 0 is the best value to return because there is a nothing just in front of your string. But there is another nothing in front of that nothing so maybe -1 is better. Of course we can continue this arguement forever until we arrive at minus infinity. Clearly, an infinite number of contradictory results can be obtained. Neither 0 or 1 is a consistent result. When using symbolic logic you must be very careful when any of the symbols can take on a value of 0 or infinity. Most logical proofs break down when values of 0 or ininity are introduced.

Lonkero's solution has strong merits. A return of an error explicitly tells the user that this can not be solved within the current logic system. In essence the user has asked the unanswerable.

I believe you can add constraints to the logic system that enables one to always derive an answer of 1 but never 0. (Unless of couse you always start your countings at 0 like some computer do. These languages define arrays starting from position 0 onwards.)

I am not sure you can add constraints that develop a closed logic system that only counts nothings once. To return 0, I think you need such a constraint to consistently derive your answer.

From the point of view of a programming language though I see no great issue with returning 0. Of course, the user will not be able to tell the difference between not finding it & it was impossible to look. Both of these cases will return a zero.
_________________________
Jack