From: JD Smith <jdsmith@as.arizona.edu>
Cc: emacs-devel@gnu.org
Subject: Re: push and pop
Date: Fri, 07 Jan 2005 14:15:12 -0700 [thread overview]
Message-ID: <1105132512.26051.75.camel@turtle.as.arizona.edu> (raw)
In-Reply-To: <jwvk6qphtxd.fsf-monnier+emacs@gnu.org>
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
next prev parent reply other threads:[~2005-01-07 21:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-07 18:21 push and pop JD Smith
2005-01-07 19:39 ` David Kastrup
2005-01-07 20:23 ` Stefan Monnier
2005-01-07 21:15 ` JD Smith [this message]
2005-01-08 2:19 ` Miles Bader
2005-01-08 15:34 ` Richard Stallman
2005-01-09 17:53 ` JD Smith
2005-01-09 19:04 ` Francis Litterio
2005-01-09 19:42 ` Luc Teirlinck
2005-01-09 19:56 ` David Kastrup
2005-01-10 20:27 ` Richard Stallman
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1105132512.26051.75.camel@turtle.as.arizona.edu \
--to=jdsmith@as.arizona.edu \
--cc=emacs-devel@gnu.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).