From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.help Subject: Re: About Circular Objects Date: Tue, 25 Dec 2012 16:52:27 +0200 Message-ID: <87ip7q2nh0.fsf@mithlond.arda> References: <20121225165249.e5822f6cc71fa88d959efcd0@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1356447169 25329 80.91.229.3 (25 Dec 2012 14:52:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Dec 2012 14:52:49 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Xue Fuqiao Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 25 15:53:03 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TnVsM-0001V0-UL for geh-help-gnu-emacs@m.gmane.org; Tue, 25 Dec 2012 15:53:03 +0100 Original-Received: from localhost ([::1]:38893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TnVs8-0000Ho-Pq for geh-help-gnu-emacs@m.gmane.org; Tue, 25 Dec 2012 09:52:48 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:57426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TnVs1-0000Hh-Dz for help-gnu-emacs@gnu.org; Tue, 25 Dec 2012 09:52:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TnVrz-0007RP-13 for help-gnu-emacs@gnu.org; Tue, 25 Dec 2012 09:52:41 -0500 Original-Received: from mta-out.inet.fi ([195.156.147.13]:58969 helo=jenni2.inet.fi) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TnVry-0007QV-Qs for help-gnu-emacs@gnu.org; Tue, 25 Dec 2012 09:52:38 -0500 Original-Received: from mithlond.arda (84.251.134.110) by jenni2.inet.fi (8.5.140.03) id 508713990417FD7F; Tue, 25 Dec 2012 16:52:28 +0200 Original-Received: from dtw by mithlond.arda with local (Exim 4.72) (envelope-from ) id 1TnVrn-0003x0-Fk; Tue, 25 Dec 2012 16:52:27 +0200 In-Reply-To: <20121225165249.e5822f6cc71fa88d959efcd0@gmail.com> (Xue Fuqiao's message of "Tue, 25 Dec 2012 16:52:49 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 195.156.147.13 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:88315 Archived-At: Xue Fuqiao [2012-12-25 16:52:49 +0800] wrote: > I have a question about the #N# read syntax and #N= syntax. Look at > this code: > > (progn > (setq x '#1=(a #1#)) > (eq x (cdr x))) > > Why does this code return nil? Isn't the second element the list > itself? No. It's the CAR of the second cons cell that points to the list itself. If you want the CDR of the first (and only) cons cell to point back to the cons cell, you would use this: (progn (setq x '#1=(a . #1#)) ; Note the dotted list. (eq x (cdr x))) => t