From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Predicate for true lists Date: Fri, 6 Jul 2018 10:00:34 -0700 (PDT) Message-ID: <515ce169-8e88-4075-8a92-e8c1a496fe7d@default> References: <87fu3vdjjk.fsf@tcd.ie> <87bmcqhhsf.fsf@tcd.ie> <87in6xgtpb.fsf@tcd.ie> <2af892df-26cb-60b2-4fd8-067fcb3d32e9@cs.ucla.edu> <87r2kh9uwx.fsf@tcd.ie> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1530896371 10040 195.159.176.226 (6 Jul 2018 16:59:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 6 Jul 2018 16:59:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Basil L. Contovounesios" , Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 06 18:59:27 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbU4r-0002UL-Vv for ged-emacs-devel@m.gmane.org; Fri, 06 Jul 2018 18:59:26 +0200 Original-Received: from localhost ([::1]:58925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbU6z-0005QS-5Q for ged-emacs-devel@m.gmane.org; Fri, 06 Jul 2018 13:01:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbU6D-0005Pu-KT for emacs-devel@gnu.org; Fri, 06 Jul 2018 13:00:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbU6A-0004rd-Gf for emacs-devel@gnu.org; Fri, 06 Jul 2018 13:00:49 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:36742) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fbU6A-0004qz-7d for emacs-devel@gnu.org; Fri, 06 Jul 2018 13:00:46 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w66GrO40141270; Fri, 6 Jul 2018 17:00:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=q53/lGsKhqzDSV1LOXHdxHI6aWhdjj46g0e7a04qyhU=; b=ABIqRXC/fNPZ23LB+MXrnftg9HAntsprzO2ecWks/aju8jjZyBbOvCskDKaQRzJHDIq/ NkZAx9ZUMiM9tZqHieNcgwfKrSgO4t02ocBxWFTI9oRg13aRic2/kz0DRgssBAOcxm6l WOmOywk/+MbPTYzCeBoMVGvcat7FT50fKrJrwL8k+RGagNj6fc7oA03sUaQCKCIRT/OA OdnOel80MwkvBcvc6A/01xx8vyEs1rjUPwaXjFL2CZ9TtOl6k4TynYeB4i1nZXQvuHoW +MvIZYBqiT6kHe0cxGrbwUxLwZBgOpd0eXxUs23Pz1LbtiJ8uof9bivLQfSzs/s6r9OE SA== Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2k0dnjtfx2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 Jul 2018 17:00:37 +0000 Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w66H0aLu015166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 6 Jul 2018 17:00:36 GMT Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w66H0aMj031445; Fri, 6 Jul 2018 17:00:36 GMT In-Reply-To: <87r2kh9uwx.fsf@tcd.ie> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4705.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8945 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807060188 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.86 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227008 Archived-At: 1. Why is "proper" better than "true"? I don't argue against "proper", but what is really gained by this change in Emacs terminology? Dunno how helpful this is (perhaps not very), but it purportedly shows how often "proper" and "true" appear in print as modifiers of "list" recently: https://books.google.com/ngrams/graph?content=3Dlist%3D%3Eproper%2Clist%3D%= 3Etrue&case_insensitive=3Don&year_start=3D2000&year_end=3D2018&corpus=3D15&= smoothing=3D0&share=3D&direct_url=3Dt4%3B%2Clist%3D%3Eproper%3B%2Cc0%3B%2Cs= 0%3B%3Blist%3D%3Eproper%3B%2Cc0%3B%3BList%3D%3Eproper%3B%2Cc0%3B.t4%3B%2Cli= st%3D%3Etrue%3B%2Cc0%3B%2Cs0%3B%3Blist%3D%3Etrue%3B%2Cc0%3B%3Blist%3D%3ETru= e%3B%2Cc0%3B%3BList%3D%3ETrue%3B%2Cc0%3B%3BList%3D%3Etrue%3B%2Cc0 They both are rare, and there doesn't seem to be much difference in their frequencies. If anything, "true list" is more used. (But this is not based only on mathematical texts - it just counts books in print.) 2. You say this in the doc string of `proper-list-length': A proper list is neither circular nor dotted (i.e., its last cdr is nil). And your entry in the manual for that function: In addition to satisfying @code{listp}, a proper list is neither circular nor dotted. Fair enough, but it depends on what is meant by a "circular" list. Does it mean only a list whose last cdr shares list structure with some other of its cdr's? If so then what you say holds. And yes, I guess that's what most of us think of. But what of a list that has a finite number of elements, so it last cdr is nil, but one or more of whose elements is itself a circular list in the above sense? Is it in some sense "circular" because of its circular-list element? IOW, a list can have finite length but still share list stucture with itself. Well, no, not really, but an element of it can be a list that shares list structure with itself. And so the finite-length list represents an infinite tree. For example, here's a one-element list whose only element is the circular list (a a a a a a ...): (setq foo '((a))) (setcdr (car foo) foo) foo ; ((a #1)) (length foo) ; 1 (nth 0 foo) ; (a #0) (nth 1 foo) ; nil (nth 0 (nth 0 foo)) ; a (nth 1 (nth 0 foo)) ; (a #0) (nth 2 (nth 0 foo)) ; nil (nth 0 (nth 0 (nth 0 foo)) ; a (nth 0 (nth 1 (nth 0 foo)) ; (a #0) (nth 0 (nth 2 (nth 0 foo)) ; nil ... It should be enough to say that a "true", or "proper" list is one that has nil as its last cdr, without adding that this means non-"circular".