emacs-devel
[Top][All Lists]
Advanced

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

Re: Rationalising c[ad]\{2,5\}r.


From: Stefan Monnier
Subject: Re: Rationalising c[ad]\{2,5\}r.
Date: Fri, 13 Mar 2015 19:00:20 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> I don't know how many of them require other bits of CL.  But the point
> is that CL is not loaded by default, so any use of cXXXr in standard
> files is awkward.  I'm thinking in particular about my new fix-re.el
> here.

You can use cl-lib freely in most files.  The only exception is for
preloaded files which can only (eval-when-compiler (require 'cl-lib))
(with some further exceptions for the earliest files, for obvious
reasons of bootstrap limitations).

So you can (eval-when-compiler (require 'cl-lib)) in fix-re.el without
any hesitation.  IOW no need to add anything to subr.el for that.
This said, fix-re.el seems to be the quintessential example of abuse of
heaps of car/cdr which make the code unreadable.

> OK, fair enough.  But unless we're talking about doing cXXXr needlessly
> in a tight loop, it's hardly going to make a noticeable difference.

Agreed.

> 1. All c[ad]\{3,4\}r are now declared in subr.el, generated from macros.

I'm still not convinced it's a good idea to add those to subr.el.

> 2. Each of these has a cl-cXXXr as an alias, declared as obsolete as
>   from 25.1.

These aliases and obsolescence settings would belong in cl-lib.el.

> 3. caar, cadr, cdar, and cddr are now declared as defuns (changed from
>   defsubsts).
> 4. All the cXXr, including caar, etc., use the compiler macro
>   `compiler-macro-cXXr' (renamed by removing "cl-" from the name).

Please keep a "--" in the name to indicate it's an internal function.
For lack of a good prefix, I'd use "internal--".


        Stefan



reply via email to

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