emacs-devel
[Top][All Lists]
Advanced

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

Re: Saving match data


From: Michael Heerdegen
Subject: Re: Saving match data
Date: Wed, 28 Sep 2016 18:49:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> That would imply adding save-match-data *everywhere*.  It's an enormous
> amount of work, can't be automated, and comes with only two obvious
> results:
> - our Elisp source code will be significantly larger.
> - Emacs will be slower.

This sounds crazy.  Sorry about this ignorant question: Why do we use
this model of match data: a global state that is changed as a side
effect in thousands of circumstances.  If you really need the match
data, the common way is to suppress that it is changed.  This discussion
shows that this approach seems to have great downsides, and it doesn't
seem very "lispy" anyway.

Why don't we just let the programmer explicitly save the match data
(e.g. to a symbol) when he is interested in it (FWIW this is already
possible with `match-data' and `save-match-data').  That would be more
transparent and work around this kind of problem.


Michael.



reply via email to

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