emacs-devel
[Top][All Lists]
Advanced

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

Re: What's missing in ELisp that makes people want to use cl-lib?


From: Richard Stallman
Subject: Re: What's missing in ELisp that makes people want to use cl-lib?
Date: Mon, 20 Nov 2023 21:43:59 -0500

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

  > > I suggest we rewrite those cl-loop calls
  > > into ordinary Lisp, avoiding use of cl-loop.

  > That would be something along the lines of:

  > (let ((comp-ctxt (make-comp-cstr-ctxt))
  >       (h (make-hash-table :test #'eq))
  >       f)
  >   (while (setq f (pop comp-known-type-specifiers))
  >     (puthash f (comp-type-spec-to-cstr type-spec) h))
  >   h)

That is simpler than the cl-loop construct that you rewrote.
Though it will alter the ambient valu eof comp-type-spec-to-cstr,
which might be undesirable.

To avoid that, we could use

   (dolist (f comp-known-type-specifiers)
     (puthash f (comp-type-spec-to-cstr type-spec) h))

and avoid binding f in the let.  That would be one line less.


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