[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Effect of string mutation on submatch extraction


After removing the string arguments from the submatch extraction
procedures, should the results of things like the following be

    (define s "abc")
    (define m (regexp-search "b" s))
    (regexp-match-submatch m 0) ; => "b"
    (string-set! s 1 #\B)
    (regexp-match-submatch m 0) ; => "b", "B", or undefined?

Chibi returns "B", which I also think is the better option since it's
simpler and probably more efficient, though "b" is arguably nicer for
the user. Either way, is it worth specifying one (even if that's just