From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Thomas F. Burdick" Newsgroups: gmane.emacs.help 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) Organization: http://groups.google.com Message-ID: References: <558fb909-6290-4c04-88a3-ad385d75f456@e1g2000pra.googlegroups.com> <9032ef00-187f-47ad-a2de-e0d07a3303ee@s38g2000prg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1238081408 30093 80.91.229.12 (26 Mar 2009 15:30:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Mar 2009 15:30:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 26 16:31:26 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LmrXs-0006o5-UU for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Mar 2009 16:31:05 +0100 Original-Received: from localhost ([127.0.0.1]:41966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LmrWV-00086i-FW for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Mar 2009 11:29:39 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!j9g2000prh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs,comp.lang.lisp Original-Lines: 90 Original-NNTP-Posting-Host: 213.131.238.28 Original-X-Trace: posting.google.com 1238073351 9335 127.0.0.1 (26 Mar 2009 13:15:51 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 26 Mar 2009 13:15:51 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j9g2000prh.googlegroups.com; posting-host=213.131.238.28; posting-account=OXadvQoAAAD_4IjogLcVrNQEI9IrIkx1 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:168004 comp.emacs:98072 comp.lang.lisp:263613 X-Mailman-Approved-At: Thu, 26 Mar 2009 11:29:14 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63296 Archived-At: On Mar 26, 3:12 am, Xah Lee wrote: > Xah Lee writes: > > > in emacs lisp's CL package documentation =E2=80=9C(info "(cl)Overview= ")=E2=80=9D, 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 no= t > > > 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" 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 =E2=80=9Cpop=E2=80=9D, it say= s: > =C2=ABpop is a Lisp macro in `subr.el'.=C2=BB > > but after loading cl, it says: > =C2=ABpop is a Lisp macro in `cl.el'.=C2=BB > > 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 > =E2=88=91http://xahlee.org/ > > =E2=98=84