[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cl-macs and (require 'cl)
From: |
Eric M. Ludlam |
Subject: |
Re: cl-macs and (require 'cl) |
Date: |
Wed, 01 Jul 2009 07:25:02 -0400 |
On Wed, 2009-07-01 at 11:43 +0200, Lennart Borgman wrote:
> On Wed, Jul 1, 2009 at 8:09 AM, Stephen J. Turnbull<address@hidden> 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