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

Re: new draft available

This page is part of the web mail archives of SRFI 115 from before July 7th, 2015. The new archives for SRFI 115 contain all messages, not just those from before July 7th, 2015.

On Mon, May 26, 2014 at 2:53 AM, John Cowan <cowan@xxxxxxxxxxxxxxxx> wrote:
I still don't like the strong wording against backreferences; I think it should say
"beware, these are expensive, use only if needed" rather than "avoid
at all costs".  The latter _expression_ raises the question "If they
should be avoided, why are they here at all?"

You're just repeating your previous argument here, so I'll
repeat my response.

They're here for backwards-compatibility, and to avoid future
forking in case people want to use them regardless of performance.
If you really know what you're doing (and what the underlying
backtracking implementation is doing), then there are uses of
backreferences that incur only a high polynomial cost.  Plus
there are games you can play like matching prime numbers
in Perl which can be amusing even if slow.

That said, the general case degenerates to exponential
backtracking, which in my book warrants as strong a warning
as I can make, waving red flags, caution: land mines, there
be dragons here, abandon all hope ye who enter here,
keep away from children, pregnant women, and drunken