From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.devel Subject: Re: To be a list or not Date: Fri, 28 Dec 2007 22:35:41 -0500 Message-ID: <18293.49293.672805.512265@rgrjr.rgrjr.com> References: <477568AC.7090304@gmail.com> <18293.28417.122146.27016@kahikatea.snap.net.nz> <47758120.5000507@gmail.com> <18293.35504.41211.784522@kahikatea.snap.net.nz> <4775925A.6020300@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1198899359 7046 80.91.229.12 (29 Dec 2007 03:35:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Dec 2007 03:35:59 +0000 (UTC) Cc: Emacs Devel To: "Lennart Borgman \(gmail\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 29 04:36:12 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 1J8SUc-0005wL-A7 for ged-emacs-devel@m.gmane.org; Sat, 29 Dec 2007 04:36:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J8SUH-0000SU-3A for ged-emacs-devel@m.gmane.org; Fri, 28 Dec 2007 22:35:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J8SUD-0000PO-5D for emacs-devel@gnu.org; Fri, 28 Dec 2007 22:35:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J8SUB-0000LF-8j for emacs-devel@gnu.org; Fri, 28 Dec 2007 22:35:44 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J8SUB-0000L2-4j for emacs-devel@gnu.org; Fri, 28 Dec 2007 22:35:43 -0500 Original-Received: from c-24-128-232-192.hsd1.ma.comcast.net ([24.128.232.192] helo=rgrjr.dyndns.org) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1J8SUB-0003aW-4h for emacs-devel@gnu.org; Fri, 28 Dec 2007 22:35:43 -0500 Original-Received: (qmail 13704 invoked by uid 500); 29 Dec 2007 03:35:41 -0000 In-Reply-To: <4775925A.6020300@gmail.com> X-Mailer: VM 7.19 under Emacs 23.0.50.1 X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:85584 Archived-At: From: "Lennart Borgman (gmail)" Date: Sat, 29 Dec 2007 01:18:34 +0100 . . . However (sequencp '(prop . val)) returns t. What I wanted to know was the recommended way to check if something is a cons cell, but not a sequence, ie something like '(prop . val). This is called an "improper list"; you could check for it thus: (defun proper-list-p (x) (and (listp x) (null (cdr (last x))))) But of course, this is O(N), and would not even terminate for circular lists, which is why the predicates are designed not to go to all that trouble. FWIW, format.el defines a format-proper-list-p that is equivalent. -- Bob Rogers http://rgrjr.dyndns.org/