I noticed Chibi's string-find-right returns the matching index + 1, or START on failure, instead of what this SRFI would suggest.

After playing with my own proposal, and realizing that every find-right result has to be incremented by 1 to be useful, I realize Chibi is doing it better.

-jim



On Mon, Feb 29, 2016 at 7:24 AM, Jim Rees <xxxxxx@gmail.com> wrote:
On Sun, Feb 28, 2016 at 11:07 PM, Alex Shinn <xxxxxx@gmail.com> wrote:

>    - There's some logic to returning where the cursor landed after deciding
> that the iterative
>      search has failed, so when searching the whole string, returning the
> post-end or pre-begin
>      cursor makes some sense.  But when searching a sub-range from START to
> END, this logic would
>      dictate returning END or (string-cursor-prev START) on not-found.  But
> this doc requires
>      returning the post-end or pre-begin cursor of the entire string
> instead.

This is what chibi does.

Cool - so would you be in agreement that the SRFI doc should be changed to read the following?

------------------------------------------------------------------------------

(string-find/cursors pred string start end)

Returns a cursor referring to the first character in the substring of string from start (inclusive) to end (exclusive) that satisfies pred, or end if there is none.

(string-find-right/cursors pred string start end)

Returns a cursor referring to the first character in the substring of string from end (exclusive) to start (inclusive) that satisfies pred, processing it in reverse order, or (string-cursor-prev string start) if there is none.

-----------------------------------------------------------------------------