Effect of string mutation on submatch extraction
Evan Hanson 15 Nov 2013 08:44 UTC
Hi,
After removing the string arguments from the submatch extraction
procedures, should the results of things like the following be
specified?
(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
"undefined")?
Evan