emacs-devel
[Top][All Lists]
Advanced

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

Re: Lisp files that load cl-lib in problematical ways


From: Emanuel Berg
Subject: Re: Lisp files that load cl-lib in problematical ways
Date: Wed, 25 Oct 2023 05:11:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Richard Stallman wrote:

> 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 [...]

Yes, but none of those codes are super-simple, to be fair,
are they?

BTW the CL case can be improved like this - if it isn't that
much simpler, then at least it is much neater, I'd say.

(while (string-match "\\W" abbrev pos)
  (cl-pushnew (aref abbrev (match-beginning 0)) badchars)
  (cl-incf pos) )

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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