Can a cursor created from one string be used with another string? Duy Nguyen (28 Jan 2020 10:48 UTC)
|
Re: Can a cursor created from one string be used with another string?
John Cowan
(28 Jan 2020 13:31 UTC)
|
Re: Can a cursor created from one string be used with another string?
Duy Nguyen
(28 Jan 2020 13:33 UTC)
|
Re: Can a cursor created from one string be used with another string?
Duy Nguyen
(28 Jan 2020 15:08 UTC)
|
Re: Can a cursor created from one string be used with another string?
Alex Shinn
(31 Jan 2020 15:32 UTC)
|
Re: Can a cursor created from one string be used with another string?
Duy Nguyen
(31 Jan 2020 16:00 UTC)
|
Re: Can a cursor created from one string be used with another string?
Alex Shinn
(01 Feb 2020 04:38 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