[racket-dev] Missing pregexp syntax in Racket

From: David T. Pierson (dtp at mindstory.com)
Date: Tue Nov 29 08:08:20 EST 2011

On Mon, Nov 28, 2011 at 12:02:46AM -0800, Pauan wrote:
> JavaScript you can saythis: /\\\d/  But before we can even consider
> such a syntax, we first need to add in theabove mentioned regexp
> syntaxes. Because otherwise #px/\n/ would compile into(pregexp "\\n")
> which would then throw an error, as you noted. So this is thefirst
> step in enabling such a syntax.

I thought of a more fundamental objection.  If I understand correctly,
you want #px/\n/ to translate to #px"\\n" which would have the same
meaning as the current meaning of #px"\n".  Were you thinking likewise
that #rx/\n/ would translate to #rx"\\n"?  That can't be changed to mean
the same as #rx"\n" because #rx"\\n" already means the same as #rx"n",
and presumably we don't want to change the meaning of existing valid
patterns.

David


Posted on the dev mailing list.