[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: push and pop

From: JD Smith
Subject: Re: push and pop
Date: Fri, 07 Jan 2005 14:15:12 -0700

On Fri, 2005-01-07 at 15:23 -0500, Stefan Monnier wrote:
> > The macros "push" and "pop" in `subr' don't do the same thing as the push
> > and pop in `cl'.  This means that if you use:
> >  (eval-when-compile (require 'cl))
> > in your code, the behavior will change depending on whether the compiled
> > version is loaded (cl version), or you are interactively debugging (subr
> > version).  An example of a semantic which will fail with the subr version
> > but not the cl version:
> >  (setq ov (pop (cdr ov-list)))
> > which requires a list argument to pop, instead of the cdr of a list.
> I don't see the problem.  When debugging code in a file that does (require
> FOO), you need to (require FOO) before doing C-x C-e or M-C-x.
> Nothing new here.
> The only difference is that in macs-20 (when subr.el didn't define its iown
> version of `pop') you'd get an error "void function `pop'" whereas now you
> get another error.

I think the confusion for me and lots of others: many installs (like
Fedora/Red Hat) include site-start stuff that does (or did) a (require
'cl) somewhere.  So it comes as unexpected when that stuff isn't
available.  So, in every emacs-20 I'd ever used, you'd get no such
error, since cl had already been loaded by default.  

When I'm debugging the code that needs FOO, the code has already been
run in that Emacs session, so it's natural to expect all of its
requirements to have been loaded.  In hindsight, I guess it makes sense
that a compile-time macro would not be loaded (since it's compiled in by
eval-when-compile) unless you explicitly reload it.  

Thanks for the pointers.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]