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: Jim Porter
Subject: Re: What's missing in ELisp that makes people want to use cl-lib?
Date: Mon, 30 Oct 2023 10:13:10 -0700

On 10/29/2023 7:09 PM, Richard Stallman wrote:
   > Of the conveniences, I think the ones I'd miss the most are 'cl-incf'
   > and 'cl-decf', which I use in Eshell for recounting some handles.

If this pattern extends to many files -- if getf, incf and decf are
particularly useful among CL constructs -- making them standard parts of Emacs 
Lisp would be better than inducing lots of files to load cl-lib.

I don't think I'd fight tooth and nail to get incf/decf, but I'd certainly be happy to see them in standard Elisp.

I'm not sure how much others want to see setf-like constructs in Elisp[1], but I like them quite a bit. They fit in neatly alongside the C/C++ parts of my brain. Specifically, I find this style:

  (cl-incf (cdr output-target))
  - or -
  output_target.tail++;

a lot nicer than this:

  (setcdr output-target (1+ (cdr output-target)))
  - or -
  output_target.tail = output_target.tail + 1;

[1] I recall that some generalized values for setf were deprecated recently, but I think that was mainly for things where the setter had some non-obvious behavior.



reply via email to

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