bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#12622: replace-regexp-in-string


From: Andreas Röhler
Subject: bug#12622: replace-regexp-in-string
Date: Fri, 12 Oct 2012 18:07:30 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120825 Thunderbird/15.0

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]