all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Eric M. Ludlam" <eric@siege-engine.com>
To: Lennart Borgman <lennart.borgman@gmail.com>
Cc: "Stephen J. Turnbull" <stephen@xemacs.org>,
	Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: cl-macs and (require 'cl)
Date: Wed, 01 Jul 2009 07:25:02 -0400	[thread overview]
Message-ID: <1246447502.22209.26.camel@projectile.siege-engine.com> (raw)
In-Reply-To: <e01d8a50907010243p7feb286ej1308da2856747c6b@mail.gmail.com>

On Wed, 2009-07-01 at 11:43 +0200, Lennart Borgman wrote:
> On Wed, Jul 1, 2009 at 8:09 AM, Stephen J. Turnbull<stephen@xemacs.org> 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




  reply	other threads:[~2009-07-01 11:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30 19:59 cl-macs and (require 'cl) Lennart Borgman
2009-06-30 21:07 ` Davis Herring
2009-06-30 21:11   ` Lennart Borgman
2009-07-01  6:09     ` Stephen J. Turnbull
2009-07-01  9:43       ` Lennart Borgman
2009-07-01 11:25         ` Eric M. Ludlam [this message]
2009-06-30 21:12 ` Stefan Monnier

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=1246447502.22209.26.camel@projectile.siege-engine.com \
    --to=eric@siege-engine.com \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.com \
    --cc=stephen@xemacs.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.