[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lisp files that load cl-lib in problematical ways
From: |
Stefan Kangas |
Subject: |
Re: Lisp files that load cl-lib in problematical ways |
Date: |
Wed, 25 Oct 2023 00:57:29 -0700 |
Richard Stallman <rms@gnu.org> writes:
> But if we let ourselves be a little more flexible, how about this
> solution: install this
>
> (while (string-match "\\W" abbrev pos)
> (or (memq (aref abbrev (match-beginning 0)) badchars)
> (push (aref abbrev (match-beginning 0)) badchars))
> (setq pos (1+ pos)))
>
> instead of the current code:
>
> (while (string-match "\\W" abbrev pos)
> (cl-pushnew (aref abbrev (match-beginning 0)) badchars)
> (setq pos (1+ pos)))
>
> A CL fan might say the latter is simpler, but for me, who isn't sure
> just how to use cl-pushnew, the former seems conceptually simpler.
The `cl-pushnew' docstring explains:
Add X to the list stored in PLACE unless X is already in the list.
> The two ecxpressions have two different kinds of complexity.
The only difference I see is that new version is harder to read, and
more prone to bugs (as you have to write the same code twice).
I'd suggest avoiding these types of changes.
- Re: Lisp files that load cl-lib in problematical ways, (continued)
- Re: Lisp files that load cl-lib in problematical ways, Richard Stallman, 2023/10/26
- Re: Lisp files that load cl-lib in problematical ways, Eli Zaretskii, 2023/10/27
- Re: Lisp files that load cl-lib in problematical ways, Emanuel Berg, 2023/10/23
- Re: Lisp files that load cl-lib in problematical ways, Björn Bidar, 2023/10/19
- Re: Lisp files that load cl-lib in problematical ways, Richard Stallman, 2023/10/22
- Re: Lisp files that load cl-lib in problematical ways, Eli Zaretskii, 2023/10/23
- Re: Lisp files that load cl-lib in problematical ways, Richard Stallman, 2023/10/24
- Re: Lisp files that load cl-lib in problematical ways,
Stefan Kangas <=
- Re: Lisp files that load cl-lib in problematical ways, Gerd Möllmann, 2023/10/25
- Re: Lisp files that load cl-lib in problematical ways, Richard Stallman, 2023/10/25
- Re: Lisp files that load cl-lib in problematical ways, Eli Zaretskii, 2023/10/26
- Re: Lisp files that load cl-lib in problematical ways, Adam Porter, 2023/10/26
- Re: Lisp files that load cl-lib in problematical ways, Eli Zaretskii, 2023/10/26
- Re: Lisp files that load cl-lib in problematical ways, Dmitry Gutov, 2023/10/26
- Re: Lisp files that load cl-lib in problematical ways, Alan Mackenzie, 2023/10/26
- Re: Lisp files that load cl-lib in problematical ways, Emanuel Berg, 2023/10/26
- Re: Lisp files that load cl-lib in problematical ways, Bob Rogers, 2023/10/26
- Re: Lisp files that load cl-lib in problematical ways, Emanuel Berg, 2023/10/27