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 01:28:08 +0200 Message-ID: <461ACC08.3000301@gmail.com> References: <4616EBD0.8020104@gmail.com> <4619903E.30608@gmail.com> <461A9B38.50507@gmail.com> <877isl9mdy.fsf@stupidchicken.com> 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 1176176152 9505 80.91.229.12 (10 Apr 2007 03:35:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Apr 2007 03:35:52 +0000 (UTC) Cc: emacs-devel@gnu.org, Stefan Monnier , rms@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 10 05:34:57 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 1Hb3IL-0005ZJ-LO for ged-emacs-devel@m.gmane.org; Tue, 10 Apr 2007 01:29:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hb3MD-0007Mr-EM for ged-emacs-devel@m.gmane.org; Mon, 09 Apr 2007 19:33:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hb3M9-0007Mf-EQ for emacs-devel@gnu.org; Mon, 09 Apr 2007 19:33:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hb3M7-0007MQ-0j for emacs-devel@gnu.org; Mon, 09 Apr 2007 19:33:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hb3M6-0007MN-Pz for emacs-devel@gnu.org; Mon, 09 Apr 2007 19:33:02 -0400 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Hb3ID-0004nz-4v; Mon, 09 Apr 2007 19:29:01 -0400 Original-Received: from c83-254-145-24.bredband.comhem.se ([83.254.145.24]:60555 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1Hb3Hu-0004cc-98; Tue, 10 Apr 2007 01:28:46 +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: <877isl9mdy.fsf@stupidchicken.com> X-Antivirus: avast! (VPS 000731-1, 2007-04-08), Outbound message X-Antivirus-Status: Clean X-Scan-Result: No virus found in message 1Hb3Hu-0004cc-98. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1Hb3Hu-0004cc-98 af7b2d10f2b02bfdda0a320d31fc30ee 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:69248 Archived-At: Chong Yidong wrote: > "Lennart Borgman (gmail)" writes: > >> Stefan Monnier wrote: >>>> But we do believe that print-circle makes it possible to print out >>>> recursive structures, or? And we do not believe that it disturbs printing >>>> out non-recursive structures (except that it gets a bit slower), or? >>> Actually, I believe it does affect printing non-circular structures in more >>> ways than just by making it slower. >>> >>> Try (let ((print-circle t) (toto (list 2))) (prin1 (list toto toto))) >>> >>> In some cases, this is a good feature, but in many other cases it can be >>> very confusing. >> >> Interesting, but is not that just another bug? > > Nope. When print-circle is on, the printer takes note of shared > substructures. It's just that in this case, taking note of shared > substructure obfuscates the value. But the result I see is (#1=(2) #1#)((2) (2)) Why are the two printed representations of toto different? Hm. The doc is a bit unclear. To me it seems like #2=(#1=(2) #1#) #2 or (#1=(2) #1#) (#1=(2) #1#) could both be possible. But not the one I actually see. Yes (disregarding the output inconsistency above), I can see this is a difficulty. print-circle does not do exactly what I supposed. I believed it only jumped in when there were recursive structures (as the name suggests). Is there any function for checking if a structure is recursive?