all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Thomas F. Burdick" <tburdick@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: elisp's cl package. Don't understand the notice about  eval-when-compile
Date: Thu, 26 Mar 2009 06:15:51 -0700 (PDT)	[thread overview]
Message-ID: <b7dc6ae2-ca7d-49c0-ae65-afc38f0ffc1a@j9g2000prh.googlegroups.com> (raw)
In-Reply-To: 9032ef00-187f-47ad-a2de-e0d07a3303ee@s38g2000prg.googlegroups.com

On Mar 26, 3:12 am, Xah Lee <xah...@gmail.com> wrote:
> Xah Lee <xah...@gmail.com> writes:
> > > in emacs lisp's CL package documentation “(info "(cl)Overview")”, it
> > > has this passage:
>
> > >    *Please note:* the "CL" functions are not standard parts of the
> > > Emacs Lisp name space, so it is legitimate for users to define them
> > > with other, conflicting meanings.  To avoid conflicting with those
> > > user
> > > activities, we have a policy that packages installed in Emacs must not
> > > load "CL" at run time.  (It is ok for them to load "CL" at compile
> > > time
> > > only, with `eval-when-compile', and use the macros it provides.)  If
> > > you are writing packages that you plan to distribute and invite
> > > widespread use for, you might want to observe the same rule.
>
> > > I don't quite understand it.
>
> On Mar 25, 3:02 am, "Thomas F. Burdick" <tburd...@gmail.com> wrote:
>
> > No. It's saying that if you are trying to get your package included in
> > the official Emacs distribution, you can only use macros from cl.el,
> > not functions.
>
> Ok, after spent some 30 min starting to write a reply with much more
> confusion, i think i understand this now and i think this is the best
> explanation. Thanks.
>
> though, there's still the practical question of which ones are macros.
> There doesn't seem to have a clear list.
>
> basically, my concern here is practical one. I want to use some
> functionalities in cl, but need to know which i can use etc. So, if
> programers using cl for their packages for public, they need to have a
> list of exactly what they can use.

The Emacs maintainers have a really schizophrenic policy when it comes
to cl.el, and it's resulted in a mess. On the one hand, they
distribute a bunch of language extensions as part of the distribution.
On the other hand, they disapprove of the very package they
distribute, so they don't want any other bundled code to use it. So of
course the extensions run the range from nice, idiomatic things that
ought to be incorporated into elisp (support for places/setf, for
example), to very useful extensions like loop, to strange duplications
of existing functionality (concatenate?), to bizzare and horrible
ideas like lexical-let.

If you want your code incorporated into the official Emacs
distribution, I would avoid cl.el altogether. Or maybe use loop and
setf, but I'm not sure you can count on them always expanding into cl-
free code. The reason there's no good documentation about what you can
use is that the Emacs maintainers frown on the whole package. So as a
practical matter, avoid it.

If you just have an elisp package that you want to make publicly
available, I see no need to avoid cl.el. It's distributed with emacs,
so there's no reason not to use it. Just, stick to the tasteful
parts :-)

> ... after some 10 min thinking and reading the cl doc, at this point i
> guess i don't have a question... i guess a clear list of macro isn't
> there because the whole thing is rather complex... the cl package is
> rather more for CL programers coming to elisp as opposed to simply a
> extra library of useful functions...

It's both. I think RMS has an irrational hatred of CL, so there are a
lot of the useful things in cl.el that should have migrated into the
core elisp. As it is, they're ghettoized along with the parts of that
package that exist just as a crutch for Common Lispers.

>
> here's some more confusion i have...
>
> For example, when i do describe-function on “pop”, it says:
> «pop is a Lisp macro in `subr.el'.»
>
> but after loading cl, it says:
> «pop is a Lisp macro in `cl.el'.»
>
> So, it appears, cl package also shadow elisp symbols (apparantly they
> are the same thing, but if so, why there's one in still in cl when
> already moved to elisp?).
>
>   Xah
> ∑http://xahlee.org/
>
> ☄


  parent reply	other threads:[~2009-03-26 13:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-25  3:02 elisp's cl package. Don't understand the notice about eval-when-compile Xah Lee
2009-03-25  4:42 ` Michael Ekstrand
2009-03-25 10:02 ` Thomas F. Burdick
2009-03-26  2:12   ` Xah Lee
2009-03-26  5:30     ` Jason Rumney
2009-03-26 13:15     ` Thomas F. Burdick [this message]
2009-04-01  1:01       ` Miles Bader
2009-03-26  8:58   ` Leo
2009-03-26  9:32     ` Juanma Barranquero
2009-03-26 12:37       ` Leo
2009-03-26 15:09         ` Samuel Wales
2009-03-26 20:09           ` Leo
2009-03-26 21:54             ` Lennart Borgman
2009-03-27  1:42         ` Kevin Rodgers
     [not found]         ` <mailman.4060.1238118196.31690.help-gnu-emacs@gnu.org>
2009-03-27  6:30           ` Xah Lee
2009-03-27  8:30             ` Kojak
2009-03-27 10:37             ` David Kastrup
2009-03-29 18:20             ` Eli Zaretskii
     [not found]             ` <mailman.4213.1238350954.31690.help-gnu-emacs@gnu.org>
     [not found]               ` <2f147e23-2e25-4cfb-885c-64d835993b12@y6g2000prf.googlegroups.com>
2009-03-30 20:03                 ` B. T. Raven
2009-03-30 20:50                   ` Lennart Borgman
2009-03-31  4:12                   ` Xah Lee
2009-03-31  5:40                     ` B. T. Raven
2009-03-31  9:50                     ` Nikolaj Schumacher
2009-03-31 10:36                     ` Alan Mackenzie
2009-03-26  2:53 ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7dc6ae2-ca7d-49c0-ae65-afc38f0ffc1a@j9g2000prh.googlegroups.com \
    --to=tburdick@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.