emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: print-circle and describe-variable


From: Lennart Borgman (gmail)
Subject: Re: print-circle and describe-variable
Date: Tue, 10 Apr 2007 01:28:08 +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

Chong Yidong wrote:
"Lennart Borgman (gmail)" <address@hidden> 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?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]