From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: Should nil COLLECTION element mean a "nil" candidate forcompleting-read? Alist doc. Date: Tue, 21 Jul 2009 17:07:49 -0700 Message-ID: References: <5721FBADB175440B9BA3383934E0AC30@us.oracle.com> <87ljmhiptc.fsf@dd.chalmers.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1248221417 29489 80.91.229.12 (22 Jul 2009 00:10:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Jul 2009 00:10:17 +0000 (UTC) To: "=?iso-8859-1?Q?'Johan_=22Bockg=E5rd=22'?=" , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 22 02:10:10 2009 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 1MTPPN-0003xu-4G for ged-emacs-devel@m.gmane.org; Wed, 22 Jul 2009 02:10:10 +0200 Original-Received: from localhost ([127.0.0.1]:50609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTPPL-0005Td-Hy for ged-emacs-devel@m.gmane.org; Tue, 21 Jul 2009 20:10:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTPNS-0004Pd-7s for emacs-devel@gnu.org; Tue, 21 Jul 2009 20:08:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTPNN-0004NU-HQ for emacs-devel@gnu.org; Tue, 21 Jul 2009 20:08:09 -0400 Original-Received: from [199.232.76.173] (port=50351 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTPNN-0004NN-AS for emacs-devel@gnu.org; Tue, 21 Jul 2009 20:08:05 -0400 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:24340 helo=rgminet11.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MTPNM-0002vj-R6 for emacs-devel@gnu.org; Tue, 21 Jul 2009 20:08:05 -0400 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n6M09V5D015648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 22 Jul 2009 00:09:33 GMT Original-Received: from abhmt002.oracle.com (abhmt002.oracle.com [141.146.116.11]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n6M07qRu014711; Wed, 22 Jul 2009 00:07:52 GMT Original-Received: from dradamslap1 (/141.144.72.165) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 21 Jul 2009 17:07:47 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87ljmhiptc.fsf@dd.chalmers.se> Thread-Index: AcoKWj7GVS9iYLGxR/mTq6kQ2WX5EwABUxSw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: abhmt002.oracle.com [141.146.116.11] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010202.4A665854.00E2:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:112967 Archived-At: > >> (completing-read "ff: " '(nil ("a") ("b))) > > > > A nil there is simply an error. We don't signal an error, but the > > none of the behaviors you may see is considered as a feature. > > If COLLECTION is an alist (*note Association Lists::), the > permissible completions are the elements of the alist that are > either strings, symbols, or conses whose CAR is a string > or symbol. > Symbols are converted to strings using `symbol-name'. Other > elements of the alist are ignored. (Remember that in Emacs Lisp, > the elements of alists do not _have_ to be conses.) In > particular, a list of strings or symbols is allowed, even though > we usually do not think of such lists as alists. > > -- (info "(elisp) Basic Completion") I gotta say, this doc is poor, and on a very slippery slope (if not already slipped to the bottom). It's one thing to say that in Emacs Lisp a non-cons is tolerated in an alist. More precisely, the doc says that it is not an error, but also that such elements ARE IGNORED. It's quite another thing to consider that alists are any lists whatsoever, that it makes no difference what the elements are. A non-cons element is ignored is different from calling every list an "alist" just because it is not an error for an alist element to be an atom. That's just plain silly and confusing. Why have a notion of alist if every list is an alist? Why say that atomic elements of alists are ignored if they are not? > (But this is not really true--the first element can't be a > symbol other than nil (or lambda).) Yes, indeed. There is so much undocumented special casing going on here that it is a mine field for users. What's the point of documenting the behavior if that doc is way off the mark and users need to discover the real behavior by trial and error?