[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: find-file-noselect needs save-match-data
From: |
Kim F. Storm |
Subject: |
Re: find-file-noselect needs save-match-data |
Date: |
Fri, 08 Jun 2007 12:31:28 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
martin rudalics <address@hidden> writes:
>> It's quite the opposite IMO. "safe" can mean many things, whereas
>> "nodata" clearly indicates that it doesn't set (or modify) match-data.
>
> "-nodata" is good.
>
>> But in practice, we should have a macro to encapsulate calls:
>>
>> (preserve-match-data (string-match ...))
>
> This would violate referential transparency. Consider
>
> (defvar foobar "foobar")
>
> (defun foo ()
> (string-match "foo" foobar)
> (match-string 0 foobar))
>
> (defun bar ()
> (string-match "bar" foobar)
> (preserve-match-data
> (foo)))
Well, I specifically intended the preserve-match-data to be used
in "closed contexts" like
(preserve-match-data (looking-at ...))
(preserve-match-data (string-match ...))
etc.
--
Kim F. Storm <address@hidden> http://www.cua.dk
- Re: find-file-noselect needs save-match-data, (continued)
- Re: find-file-noselect needs save-match-data, Richard Stallman, 2007/06/06
- Re: find-file-noselect needs save-match-data, martin rudalics, 2007/06/06
- Re: find-file-noselect needs save-match-data, Stefan Monnier, 2007/06/06
- Re: find-file-noselect needs save-match-data, Lennart Borgman (gmail), 2007/06/06
- Re: find-file-noselect needs save-match-data, martin rudalics, 2007/06/06
- Re: find-file-noselect needs save-match-data, Richard Stallman, 2007/06/06
- Re: find-file-noselect needs save-match-data, Stefan Monnier, 2007/06/06
- Re: find-file-noselect needs save-match-data, Richard Stallman, 2007/06/08
- Re: find-file-noselect needs save-match-data, Kim F. Storm, 2007/06/08
- Re: find-file-noselect needs save-match-data, martin rudalics, 2007/06/08
- Re: find-file-noselect needs save-match-data,
Kim F. Storm <=
- Re: find-file-noselect needs save-match-data, Richard Stallman, 2007/06/09
- Re: find-file-noselect needs save-match-data, Herbert Euler, 2007/06/09
- Re: find-file-noselect needs save-match-data, Herbert Euler, 2007/06/09
- Re: find-file-noselect needs save-match-data, Richard Stallman, 2007/06/09
- Re: find-file-noselect needs save-match-data, Juri Linkov, 2007/06/09
- Re: find-file-noselect needs save-match-data, David House, 2007/06/09
- Re: find-file-noselect needs save-match-data, Juri Linkov, 2007/06/09
- Re: find-file-noselect needs save-match-data, Jason Rumney, 2007/06/09
- Re: find-file-noselect needs save-match-data, Miles Bader, 2007/06/09
- RE: find-file-noselect needs save-match-data, Drew Adams, 2007/06/09