This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Emacs Lisp useage of the cl package

4 posts · 5924 views

I'm going to be writing more Emacs Lisp. Given that I feel more comfortable working in CL than Emacs Lisp, I was thinking about using the Emacs CL-compatibility package to help with a lot of the code. I was curious what people's view of the Emacs CL compatibility package is when writing Emacs Lisp. Is it viewed as a crutch for CL users who can't make the switch, or something that happens quite a lot?
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/

Re: Emacs Lisp useage of the cl package

I started learning CL after writing some Emacs customization functions and quickly noticed the difference. You'll need things like lexical-let for lexical scoping (returning lambdas that will work correctly), defun* (for optional and keyword parameters), defmacro* (for &body) and other. I may be mistaking, but the CL package seems like a patch that ads missing features, it's not just a compatibility layer so there is no point in sticking with plain Emacs Lisp.

Re: Emacs Lisp useage of the cl package

But I find the cl package sooooo useful (if only for loop). A quick hack revels that it is used quite often in emacs itself:
$ find /usr/share/emacs/23.0.60/lisp -name "*.el.gz" | xargs zgrep "(require 'cl)" | wc -l
297
Pedro kroger

Re: Emacs Lisp useage of the cl package

findinglisp wrote:I'm going to be writing more Emacs Lisp. Given that I feel more comfortable working in CL than Emacs Lisp, I was thinking about using the Emacs CL-compatibility package to help with a lot of the code. I was curious what people's view of the Emacs CL compatibility package is when writing Emacs Lisp. Is it viewed as a crutch for CL users who can't make the switch, or something that happens quite a lot?
It's almost impossible not to use CL package for serious emacs lisp project ;)