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: Richard Stallman
Subject: Re: Lisp files that load cl-lib in problematical ways
Date: Tue, 24 Oct 2023 22:47:23 -0400

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > It would not have helped to define cl-pushnew on cl-macs, because
  > cl-pushnew calls cl-adjoin, which is a function defined on cl-lib.  So
  > basically cl-pushnew is a (rather thin) wrapper around cl-adjoin, and
  > thus it is correctly defined on the same file where cl-adjoin is
  > defined.

That is a good point -- for that particular solution I proposed.

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 two ecxpressions have two different kinds of complexity.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





reply via email to

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