From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Re: push and pop Date: Fri, 07 Jan 2005 14:15:12 -0700 Message-ID: <1105132512.26051.75.camel@turtle.as.arizona.edu> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1105134755 19471 80.91.229.6 (7 Jan 2005 21:52:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Jan 2005 21:52:35 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 07 22:52:20 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Cn21r-0007hU-00 for ; Fri, 07 Jan 2005 22:52:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cn2DE-00071o-0F for ged-emacs-devel@m.gmane.org; Fri, 07 Jan 2005 17:04:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Cn2Cu-0006wt-J1 for emacs-devel@gnu.org; Fri, 07 Jan 2005 17:03:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Cn2Cs-0006vl-EY for emacs-devel@gnu.org; Fri, 07 Jan 2005 17:03:42 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cn2Cs-0006vX-8U for emacs-devel@gnu.org; Fri, 07 Jan 2005 17:03:42 -0500 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1Cn21E-0006kq-3f for emacs-devel@gnu.org; Fri, 07 Jan 2005 16:51:40 -0500 Original-Received: from [128.196.210.37] (helo=nsa.as.arizona.edu) by mx20.gnu.org with esmtp (Exim 4.34) id 1Cn1S9-0006nh-OJ for emacs-devel@gnu.org; Fri, 07 Jan 2005 16:15:27 -0500 Original-Received: from biff.as.arizona.edu (biff.as.arizona.edu [128.196.211.142]) by nsa.as.arizona.edu (8.12.10/8.12.10) with ESMTP id j07LFDkT028143 for ; Fri, 7 Jan 2005 14:15:13 -0700 Original-Received: from turtle.as.arizona.edu (IDENT:U2FsdGVkX18rbz9fk3wuIODZTfgEDaPs3wjrlDH8YFc@turtle.as.arizona.edu [128.196.208.207]) by biff.as.arizona.edu (8.12.8/8.12.8) with ESMTP id j07LFCet018335; Fri, 7 Jan 2005 14:15:12 -0700 Original-To: Stefan Monnier In-Reply-To: X-Mailer: Evolution 2.0.3 (2.0.3-1) X-Scanned-By: MIMEDefang 2.42 X-MailScanner: Found to be clean X-MailScanner-SpamCheck: so2: not spam, SpamAssassin (score=-2.784, required 8, autolearn=disabled, ALL_TRUSTED -2.82, AWL 0.04) X-MailScanner-From: jdsmith@as.arizona.edu X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:32015 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32015 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