unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Saving match data
@ 2016-09-28 14:01 Philipp Stephani
  2016-09-28 15:03 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Philipp Stephani @ 2016-09-28 14:01 UTC (permalink / raw)
  To: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 808 bytes --]

Hi,

the Elisp manual (section "The Match Data") says:

"Notice that all functions are allowed to overwrite the match data
unless they’re explicitly documented not to do so."

I think this statement is surprising and puts unnecessary burden on Elisp
programmers. The usual expectation is that global state is *not* modified
unless explicitly specified. Taken literally, Elisp programmers need to
surround even calls to `car' with `save-match-data' because the
documentation of `car' doesn't specify that it doesn't change the match
data. How about changing the statement to

"Notice that no functions are allowed to overwrite the match data unless
they're explicitly documented to do so."

and then clean up existing documentation and add `save-match-data' where
appropriate.

Philipp

[-- Attachment #2: Type: text/html, Size: 1021 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2017-10-08 16:01 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-28 14:01 Saving match data Philipp Stephani
2016-09-28 15:03 ` Eli Zaretskii
2016-09-28 16:11 ` Stefan Monnier
2016-09-28 16:49   ` Michael Heerdegen
2016-09-28 18:25     ` Stefan Monnier
2016-09-28 18:37       ` Michael Heerdegen
2016-09-28 20:00     ` Eli Zaretskii
2016-09-28 20:15       ` Michael Heerdegen
2016-09-28 20:22         ` Eli Zaretskii
2016-09-28 20:42           ` Michael Heerdegen
2016-09-28 20:58             ` Lars Ingebrigtsen
2016-09-29  2:36             ` Eli Zaretskii
2016-10-08  4:02               ` Michael Heerdegen
2016-10-08  6:25                 ` Eli Zaretskii
2016-10-08 15:06                 ` Stefan Monnier
2017-06-16 19:24   ` Philipp Stephani
2017-06-16 19:53     ` Stefan Monnier
2017-06-16 22:16       ` Philipp Stephani
2017-06-17 13:53         ` Stefan Monnier
2017-06-17 14:02           ` Philipp Stephani
2017-10-08 15:56             ` Philipp Stephani
2017-10-08 16:01       ` Philipp Stephani
2016-09-28 17:00 ` Marcin Borkowski
2016-09-29  9:29   ` Uwe Brauer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).