Email list hosting service & mailing list manager

Can a cursor created from one string be used with another string? Duy Nguyen (28 Jan 2020 10:48 UTC)

Can a cursor created from one string be used with another string? Duy Nguyen 28 Jan 2020 10:47 UTC

In the SRFI, "cursors are opaque objects that point into strings"
gives me the impression that cursors are tied to the string they
should only be used with that string. Using them on a different string
is undefined/error behavior. However srfi-130-test.scm does this

(string-cursor->index "" (string-cursor-start "")

This works if the cursor is simply essentially an index (maybe
negative one to differentiate it from indexes) but if a cursor is a C
pointer to the string, then it won't work because the first empty
string is not the same as the second one.

So while the test works for the reference implementation, it's not
correct, right? I'm working on Gauche implementation for this srfi. If
tests like above are correct, I'll need to rethink how I should do it.
--
Duy