Email list hosting service & mailing list manager

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 13:33 UTC

If by "those lines" you meant in the test file, I can submit a pull
request later. There are more of those.

On Tue, Jan 28, 2020 at 8:31 PM John Cowan <xxxxxx@ccil.org> wrote:
>
> Yes, it's an error and should be removed.  Art, can you take those lines out?  It will probably work on some systems, either because the cursors are indexes under the table, or because Scheme doesn't require that all empty strings are different in the sense of eq?.
>
> On Tue, Jan 28, 2020 at 5:48 AM Duy Nguyen <xxxxxx@gmail.com> wrote:
>>
>> 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

--
Duy