On Thu, Dec 3, 2015 at 2:56 PM, John Cowan <xxxxxx@mercury.ccil.org> wrote:
Per Bothner scripsit:

> I'd like to see some better justification for this unusual choice.

The idea is that when iterating in reverse order, the pre-start cursor
serves the function of the post-end cursor when iterating normally.  Thus
span-find-right returns the pre-start when it can't find anything; returning
the post-end would be bizarre.  However, indexing is always done forward.
If the -right functions were flushed, the pre-start cursor could go too.

This is what chibi does.  It does create a cursor which is invalid
for any reference or subspan (as opposed to the cursor just past
the end which is valid only as an end index).

The alternatives for failed match on -right are:

1. return #f (not type friendly)
2. return the past-the-end cursor (counterintuitive)

-- 
Alex