From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eric M. Ludlam" Newsgroups: gmane.emacs.devel Subject: Re: cl-macs and (require 'cl) Date: Wed, 01 Jul 2009 07:25:02 -0400 Message-ID: <1246447502.22209.26.camel@projectile.siege-engine.com> References: <54960.130.55.118.19.1246396027.squirrel@webmail.lanl.gov> <87hbxxvss3.fsf@uwakimon.sk.tsukuba.ac.jp> Reply-To: eric@siege-engine.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1246447663 16054 80.91.229.12 (1 Jul 2009 11:27:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jul 2009 11:27:43 +0000 (UTC) Cc: "Stephen J. Turnbull" , Emacs-Devel devel To: Lennart Borgman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 01 13:27:35 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MLxyP-0004aR-LO for ged-emacs-devel@m.gmane.org; Wed, 01 Jul 2009 13:27:34 +0200 Original-Received: from localhost ([127.0.0.1]:44065 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLxyO-0002S9-Uc for ged-emacs-devel@m.gmane.org; Wed, 01 Jul 2009 07:27:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLxw1-0001FQ-7q for emacs-devel@gnu.org; Wed, 01 Jul 2009 07:25:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLxvz-0001EL-Tx for emacs-devel@gnu.org; Wed, 01 Jul 2009 07:25:04 -0400 Original-Received: from [199.232.76.173] (port=52805 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLxvz-0001EH-P7 for emacs-devel@gnu.org; Wed, 01 Jul 2009 07:25:03 -0400 Original-Received: from static-71-184-83-10.bstnma.fios.verizon.net ([71.184.83.10]:40249 helo=projectile.siege-engine.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MLxvz-0006XF-Da for emacs-devel@gnu.org; Wed, 01 Jul 2009 07:25:03 -0400 Original-Received: from projectile.siege-engine.com (localhost [127.0.0.1]) by projectile.siege-engine.com (8.14.3/8.14.3/Debian-6) with ESMTP id n61BP531024292; Wed, 1 Jul 2009 07:25:07 -0400 Original-Received: (from zappo@localhost) by projectile.siege-engine.com (8.14.3/8.14.3/Submit) id n61BP25p024290; Wed, 1 Jul 2009 07:25:02 -0400 X-Authentication-Warning: projectile.siege-engine.com: zappo set sender to eric@siege-engine.com using -f In-Reply-To: X-Mailer: Evolution 2.26.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111849 Archived-At: On Wed, 2009-07-01 at 11:43 +0200, Lennart Borgman wrote: > On Wed, Jul 1, 2009 at 8:09 AM, Stephen J. Turnbull wrote: > > Lennart Borgman writes: > > > > > The reason I am asking is that eieio.el > > > > *shiver* > > > > eieio has special needs. You should ask the author(s) why they did it > > this way, rather than using `(eval-when-compile (require 'cl))'. If > > they don't have any particular reason other than "well, it's been like > > that since 1997", then you could try changing it to the recommended > > form. > > Yes, that is why I asked here. Eric said he will change it. > > But I do not know of any particular reason for including cl.el and > cl-macs.el like they did. Maybe you could explain? Indeed, that is just the way it has been for a long time. I did try switching to the `eval-when-compile' part, but this doesn't work. EIEIO has functions which create types with deftype, and uses typep. If I wrap the require of cl as above, then sources creating classes can't find the typep symbol. It could be I am using deftype and typep in some inconsistent way. If someone is interested in pointing out the correct way to do these things, I'd appreciate it. You can look at EIEIO w/out getting the whole CEDET suite here: http://cedet.cvs.sourceforge.net/viewvc/*checkout*/cedet/cedet/eieio/eieio.el?revision=1.185&pathrev=MAIN Offending line #1 is at 569: There is some crufty old code here that can probably be done differently. I changed the eval thing in my copy to see if I could fix it, but ran into a new problem: The next offending line is at 1389 (defun eieio-perform-slot-validation (spec value) "Return non-nil if SPEC does not match VALUE." ;; typep is in cl-macs (or (eq spec t) ; t always passes (eq value eieio-unbound) ; unbound always passes (typep value spec))) I'm not sure about this one. While it is true that EIEIO can disable slot validation, I get a lot of value from it while developing new code. Eric