[plt-scheme] Odd behavior in regexp-replace (299.25-cvs4jan2005)

From: Richard Cobbe (cobbe at ccs.neu.edu)
Date: Tue Jan 4 19:54:16 EST 2005

On Tue, Jan 04, 2005 at 06:05:12PM -0600, Robby Findler wrote:
> The "strings" in the documentation correspond to the actual characters
> in the string (as returned by, say, string-ref) not their Scheme
> representation. So, this phrase:
> 
>   If a ``\'' is followed by anything other than a digit, ``&'', ``\'',
>   or ``$'', then it is treated as ``\0''.

That was the problem; I missed this sentence.  Thanks.

Just out of curiosity, what's the design rationale for this?

<SNIP>

> The whole thing is definitely confused by the fact that you have to
> escape the backslashes twice: once for scheme string syntax and once
> for the library processing the string. 

That doesn't bother me so much; I've done enough regexp processing in
Emacs and C to get used to that.  It's just not obvious that one has to
escape the backslash for the regexp library here.

> Maybe we need to string boxes.

Not sure exactly what you mean by "string boxes" here.  If you're
suggesting something like XML boxes, then I officially declare myself as
indifferent.  They break interoperability with Emacs, so I won't use
them.

Richard



Posted on the users mailing list.