From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: print-circle and describe-variable Date: Tue, 10 Apr 2007 17:33:11 +0200 Message-ID: <461BAE37.9010208@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1176247876 26098 80.91.229.12 (10 Apr 2007 23:31:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Apr 2007 23:31:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 11 01:30:35 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HbILE-0007Bf-S2 for ged-emacs-devel@m.gmane.org; Tue, 10 Apr 2007 17:33:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HbIPB-0006xH-7w for ged-emacs-devel@m.gmane.org; Tue, 10 Apr 2007 11:37:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HbIP6-0006vM-RO for emacs-devel@gnu.org; Tue, 10 Apr 2007 11:37:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HbIP5-0006v0-6W for emacs-devel@gnu.org; Tue, 10 Apr 2007 11:37:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HbIP5-0006ux-3G for emacs-devel@gnu.org; Tue, 10 Apr 2007 11:37:07 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HbIL7-0001rN-Ru for emacs-devel@gnu.org; Tue, 10 Apr 2007 11:33:02 -0400 Original-Received: from c83-254-145-24.bredband.comhem.se ([83.254.145.24]:61681 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1HbIL5-0000M0-69; Tue, 10 Apr 2007 17:33:00 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666 In-Reply-To: X-Antivirus: avast! (VPS 000731-1, 2007-04-08), Outbound message X-Antivirus-Status: Clean X-Scan-Result: No virus found in message 1HbIL5-0000M0-69. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1HbIL5-0000M0-69 0ac87a7cb727ae45a749bda665f3eb04 X-detected-kernel: Linux 2.6? (barebone, rare!) 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: news.gmane.org gmane.emacs.devel:69266 Archived-At: Drew Adams wrote: >>>> But the result I see is >>>> >>>> (#1=(2) #1#)((2) (2)) >>>> >>>> Why are the two printed representations of toto different? >>> I think you are seeing: 1) the side-effect result of `prin1' printing, >>> followed by 2) the returned value, printed normally. (#1=(2) #1#) is the >>> former; ((2) (2)) is the latter. >> But it is the output of (prin1 (list toto toto)), isn't it? > > I'm not sure what you mean (by "it" and by "the output", for instance). > > During the invocation of `prin1', the `print-circle' binding is in effect, > so (#1=(2) #1#) is what is printed (by the side effect of `prin1'). > > The binding is finished after the expression evaluation, and that is when > the command loop prints the value that is returned by the expression. > Printing of this value is thus done using the default value of > `print-circle', nil, so you see ((2) (2)). Yes, but the let binding is in effect when printing the second toto too, or? The argument to print1 is (list toto toto).