From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: quote doesn't produce a fresh object Date: Tue, 08 Jun 2004 11:12:53 -0600 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <40C5F395.5000609@yahoo.com> References: <1086558449.12866.2576.camel@hc-dbashfor.stjude.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1086714809 24009 80.91.224.253 (8 Jun 2004 17:13:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 8 Jun 2004 17:13:29 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 08 19:13:22 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BXkA5-00010j-00 for ; Tue, 08 Jun 2004 19:13:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BXkAg-000528-Ni for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Jun 2004 13:13:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BXkAe-0004zt-ND for bug-gnu-emacs@gnu.org; Tue, 08 Jun 2004 13:13:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BXkAd-0004yg-5C for bug-gnu-emacs@gnu.org; Tue, 08 Jun 2004 13:13:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BXkAd-0004yX-2U for bug-gnu-emacs@gnu.org; Tue, 08 Jun 2004 13:13:55 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BXk9W-0001QK-HM for bug-gnu-emacs@gnu.org; Tue, 08 Jun 2004 13:12:46 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BXk9R-0003FN-00 for ; Tue, 08 Jun 2004 19:12:44 +0200 Original-Received: from 170.207.51.80 ([170.207.51.80]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Jun 2004 19:12:41 +0200 Original-Received: from ihs_4664 by 170.207.51.80 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Jun 2004 19:12:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: bug-gnu-emacs@gnu.org Original-Lines: 21 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 170.207.51.80 User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:8153 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:8153 Don Bashford wrote: > (defun myfun (x) > (let ((xs '(nil))) > (print xs) > (setcar xs "foo")) > t) > > On first invocation, (myfun 'arg) prints (nil) and returns t, as > expected. But on second invocation, it prints ("foo"). It seems in the > second invocation, the let variable xs gets the old object from the > previous invocation. If '(nil) is changed to (list nil) in myfun, the > problem does not occur, so the problem is with quote, not with let. That is not a bug. 'FORM is equivalent to (quote FORM) and is used to denote a constant Lisp object, so the xs symbol should reference the original object (which is cons'ed when the defun form is read, not when it is evaluated). -- Kevin Rodgers