Questions tagged [cl-lib]

Use this tag for questions about functions, macros, and variables defined in cl-lib. Furthermore, use it for questions about the package cl-lib.el itself, about the old package cl.el and about the compatibility layer cl-compat.el.

Use this tag for question about functions, macros, and variables defined in packages cl-lib.el, cl-macs.el, and cl-seq.el.

You can also use this tag for questions about the libraries themselves, about the old package cl.el, or about the compatibility layer cl-compat.el.

25 questions
19
votes
2 answers

What's the correct replacement for flet on new emacsen?

I have some code that uses flet to temporarily change the behaviour of functions. ;; prevent changing the window (flet ((pop-to-buffer (buffer &rest args) (switch-to-buffer buffer))) (compilation-next-error-function n…
Wilfred Hughes
  • 6,920
  • 2
  • 31
  • 60
3
votes
3 answers

Where is cl-constantly and what to use instead?

In Common Lisp, there is constantly function, which creates new function without side-effects that takes any number of arguments and always returns specified value. For some reason cl-lib doesn't provide cl-constantly, so I guess it should exist in…
Mark Karpov
  • 4,943
  • 1
  • 26
  • 54
1
vote
1 answer

Is it necessary for me to use `cl-labels` in this grouping function, when plain recursion does the job as well?

So I'm reading through some tutorials with Common Lisp, and I came across this function, group: (defun group (source n) (if (zerop n) (error "zero length")) (labels ((rec (source acc) (let ((rest (nthcdr n source))) …
Tariq Kamal
  • 390
  • 1
  • 9
1
vote
0 answers

Suppress creation of slot accessors for cl-defstruct :include slots?

Is it possible to suppress creation of slot accessors for slots included via :include? For example, in the following: (cl-defstruct person name (age 0) sex) (cl-defstruct (astronaut (:include person (age 45))) helmet-size (favorite-beverage…
ebpa
  • 7,449
  • 29
  • 55