3

I have been using ELISP for a while and now I have decided to use Common Lisp using cl-lib.el extension for Emacs. The question is does cl-lib.el provide a complete CLISP extension for Emacs or it partially supports CLISP? The other question, if I include cl-lib.el in one package (I have multiple packages), does that mean the cl-lib.el will also be applied to all other packages? For example, if I have:

(load "~/elisp/file1.el") ; (require 'cl-lib.el)
(load "~/elisp/file2.el") ; does it automatically use cl-lib.el or not?
4
  • 1
    cl-lib.el is a subset of cl.el. It was created because some people wanted to use some of the more commonly used parts of cl.el, without needing to load all of cl.el at runtime. Commented Jun 30, 2017 at 15:17
  • If you want to load the CL macros at byte-compile time, and you do not need any CL functions at runtime, then you need not load either cl-lib.el or cl.el at runtime - just (eval-when-compile (require 'cl)) or (eval-when-compile (require 'cl-lib)) Commented Jun 30, 2017 at 15:23
  • 3
    Side note: CLISP is the name of a specific Common Lisp compiler, it's not the name of the language. Commented Jul 1, 2017 at 9:44
  • 4
    @Drew: cl-lib is not really a subset of cl. It's more like the successor of cl, with the main difference being the naming (all definitions have a name that starts with the cl- prefix). A few parts of cl have been moved to core when cl-lib was introduced (mostly setf), and some rare elements were dropped altogether, and others rare elements were added as well, but overall, they pretty much have the same contents. Commented Jul 3, 2017 at 19:06

2 Answers 2

4
  1. No; neither cl-lib.el nor cl.el is equivalent to Common Lisp. Not at all.

  2. Once a library has been loaded, it is loaded. If you load file1 and it loads cl-lib, then when you later load file2, cl-lib has already been loaded. All that matters is the order of loading.

Sign up to request clarification or add additional context in comments.

2 Comments

I was hoping to hear something else! I hope one day we have a complete Emacs written in Common Lisp.
Me too. ;-) I doubt it will ever come, but I think Common Lisp would be great for Emacs.
3

If you were hoping that cl / cl-lib would provide more of Common Lisp than they do, you may be interested in https://www.emacswiki.org/emacs/EmacsCommonLisp

1 Comment

Thanks for sharing. I already checked it out. It's not very clear on cl-lib can do or cannot do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.