[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.
JD
- push and pop, JD Smith, 2005/01/07
- Re: push and pop, David Kastrup, 2005/01/07
- Re: push and pop, Stefan Monnier, 2005/01/08
- Re: push and pop,
JD Smith <=
- Re: push and pop, Miles Bader, 2005/01/07
- Re: push and pop, Richard Stallman, 2005/01/08
- Re: push and pop, JD Smith, 2005/01/09
- Re: push and pop, Francis Litterio, 2005/01/09
- Re: push and pop, Luc Teirlinck, 2005/01/09
- Re: push and pop, David Kastrup, 2005/01/09
- Re: push and pop, Richard Stallman, 2005/01/10