From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: 'length' function for lists and cons cells? Date: Thu, 21 Mar 2013 15:05:16 -0700 Message-ID: <4080986E7D894641B2B9A10FAF3FDCBC@us.oracle.com> References: <87620k7gwm.fsf@gmail.com> <87ip4kfrmf.fsf@rosalinde.fritz.box> <871ub876us.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1363903536 8350 80.91.229.3 (21 Mar 2013 22:05:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Mar 2013 22:05:36 +0000 (UTC) To: "'Thorsten Jolitz'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 21 23:06:00 2013 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 1UIncV-00056R-M6 for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Mar 2013 23:05:59 +0100 Original-Received: from localhost ([::1]:51115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UInc8-0003T8-5A for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Mar 2013 18:05:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UInbx-0003Sg-GX for help-gnu-emacs@gnu.org; Thu, 21 Mar 2013 18:05:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UInbu-0001o9-MT for help-gnu-emacs@gnu.org; Thu, 21 Mar 2013 18:05:25 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:41904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UInbu-0001nx-Ek for help-gnu-emacs@gnu.org; Thu, 21 Mar 2013 18:05:22 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r2LM5JmW030552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 21 Mar 2013 22:05:20 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r2LM5JPK027827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 Mar 2013 22:05:19 GMT Original-Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r2LM5I3E022538; Thu, 21 Mar 2013 17:05:18 -0500 Original-Received: from dradamslap1 (/130.35.178.8) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 21 Mar 2013 15:05:18 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <871ub876us.fsf@gmail.com> Thread-Index: Ac4mf0ki9JbtWQUkTk+XPriRVITV6QAAEbFA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 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:89643 Archived-At: > actually I'm looking for a way to distinguish between cons cells and > regular lists to avoid the errors when mapping an alist that contains > both with functions that work only on one of them, using 'length' was > just a hack. You distinguish them by the way they are distinguished ;-), i.e., by whether the cdr of the last cons cell is non-nil. A true list is either nil or a cons that has a true list as its cdr. This implies that it has nil as the cdr of its last cons. See my previous message.