Subject: Re: bug#12622: replace-regexp-in-string

From: Andreas Röhler <[email-masked]>
Date: Fri, 12 Oct 2012 18:07:30 +0200

Am 12.10.2012 16:22, schrieb Stefan Monnier:
>> Nonetheless consider it a design flaw, us it requires a argument taking
>> function, where a expression just to evaluate would suffice.
>
> You need some way to distinguish "here's an expression that will return
> the string that needs to be passed as argument" from "here's the
> expression that needs to be passed as argument, to be evaluated later in
> each iteration of the loop".  The distinction is made by wrapping the
> expression in a `lambda'.
>
>
>          Stefan
>

will keep that under my pillow :)

back to the question:

what about writing here instead

  (funcall rep (match-string 0 str)))

just

(eval rep)

i.e. let the user decide how to construct, if not delivered a regexp as string

Best,

Andreas