From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: Predicate for true lists Date: Sat, 07 Jul 2018 20:06:01 +0300 Message-ID: <874lhbvuva.fsf@tcd.ie> 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> <83h8lcnbxb.fsf@gnu.org> <6fc589d1-2c21-3e9b-be47-b7700f61642d@cs.ucla.edu> <831scflefs.fsf@gnu.org> <5d0d79d3-6291-fbf0-1028-064f86787483@cs.ucla.edu> <837em7jrag.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1530983091 9137 195.159.176.226 (7 Jul 2018 17:04:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Jul 2018 17:04:51 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Paul Eggert , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 07 19:04:47 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 1fbqdY-0002EX-7k for ged-emacs-devel@m.gmane.org; Sat, 07 Jul 2018 19:04:44 +0200 Original-Received: from localhost ([::1]:34390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbqff-0003Y3-EJ for ged-emacs-devel@m.gmane.org; Sat, 07 Jul 2018 13:06:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbqez-0003Vv-Jq for emacs-devel@gnu.org; Sat, 07 Jul 2018 13:06:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbqew-00049R-Eu for emacs-devel@gnu.org; Sat, 07 Jul 2018 13:06:13 -0400 Original-Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:39907) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fbqew-00048b-7S for emacs-devel@gnu.org; Sat, 07 Jul 2018 13:06:10 -0400 Original-Received: by mail-wm0-x229.google.com with SMTP id h20-v6so1109731wmb.4 for ; Sat, 07 Jul 2018 10:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=DtD2H0IXtDwqn7wyijcTg8Z2PprG0dN4vWkAl/FItR0=; b=UOdHg1BbJa4+/Af+2O8Tyvmokh3iPI+aFn/oG4Sn/7kd/HvL3itSvpx4BMhC+HEPGw snSDIzDOQj1upE5o0gy0m++QlWP+frhw1yzwOwPWVz+5Y7yw+eyUf51heC2xWsHiKfmU vmepD6yGw1Nef1Hvm+rz0qlRuHGyuegbdIpzwbK4RG+YgHYfHW2JbygreD5T822MdT3h me5jdN/vIaed1fnyGHb7CLNcbtRo8YN5jWvia1r2ke5ulBBsQKdmwUVEzA8mZn+qDIm9 D2PSEqOrwKrjUvANVyEZyBTe42lmEt7ZoEwjt4g/MJWZ4TlMlCHAEC3IFZAfWYs6QEPp RErg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=DtD2H0IXtDwqn7wyijcTg8Z2PprG0dN4vWkAl/FItR0=; b=kJpXi3c/icxUpVJHBDHvSUxd5ke6x0u9t3XuElRUQYXT3buyqh5vlvmA0wFMkua+Cx mXVGad9YCfWVN8OQuQZkxREbm6z4VSXtPkImNcSq7xuWmwYMmSsQkSs7djf2BVHMuk2W z0yCRkuNgCSBs/gfxZyANez5OS17g8uES/3q72WIzO7JNlxafHano3zJLyG9rrqv924t rBAh06ZRXIsPcTBzoIH2i1mnsZpoY9IPj7XgfgCmnnosoSyuDsK0MnrDBlVfcOUND+HU qS02VnwA78Fg3et/3B5BZCl3rAettp309jJSxFrADL1QoFg72VaHf9fdQvKsdfRDPCqR oxEg== X-Gm-Message-State: APt69E0cEAefFZL0dK39iU0iDfQt5QECO6azidWP1pFVySk/eSaMyb2a JBxysEm/Cxk6pTYXy0Ur4NrQaXrF X-Google-Smtp-Source: AAOMgpdylamF2k6U9B93lbtmNizLQf8YOtmn6dyjpEFS8J707oFY948bYhFUxCFuNGn9ZmaAndXlyg== X-Received: by 2002:a1c:647:: with SMTP id 68-v6mr9484229wmg.82.1530983168933; Sat, 07 Jul 2018 10:06:08 -0700 (PDT) Original-Received: from localhost (adsl-44.91.140.91.tellas.gr. [91.140.91.44]) by smtp.gmail.com with ESMTPSA id q70-v6sm18724241wmd.45.2018.07.07.10.06.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Jul 2018 10:06:08 -0700 (PDT) In-Reply-To: <837em7jrag.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 7 Jul 2018 13:04:07 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::229 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:227071 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> Cc: contovob@tcd.ie, emacs-devel@gnu.org >> From: Paul Eggert >> Date: Sat, 7 Jul 2018 01:41:38 -0700 >> >> Eli Zaretskii wrote: >> > the documentation still doesn't say that 'length' signals >> > an error for anything that is not a sequence, which is what >> > proper-list-p is relying on. >> >> The proposed implementation of proper-list-p does not rely on such a signal, > > That's not my reading of the implementation: > > (and (listp object) (ignore-errors (length object))) > ^^^^^^^^^^^^^ Sorry, I completely overlooked Paul's message[1] that you were replying to. I now understand what you meant by your reading of the implementation. Given that the two of you suggested both the need for the doc fix and its wording, I think you should ignore my patch[2] and push the change yourself. Here is yet another updated patch, should you disagree: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-length-NON-SEQUENCE-documentation.patch >From 79c6e0e80ebdcd0066654d72514dd08891155a77 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sat, 7 Jul 2018 19:33:08 +0300 Subject: [PATCH] Fix (length NON-SEQUENCE) documentation Suggested by Eli Zaretskii and Paul Eggert in the following threads: https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00171.html https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00177.html https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00206.html * doc/lispref/sequences.texi (Sequence Functions): Mention that 'length' signals a 'wrong-type-argument' also when given a non-sequencep argument. --- doc/lispref/sequences.texi | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 59faf2b4f1..188a345114 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -71,13 +71,15 @@ Sequence Functions @cindex list length @cindex vector length @cindex sequence length +@cindex bool-vector length @cindex char-table length @anchor{Definition of length} -This function returns the number of elements in @var{sequence}. If -@var{sequence} is a dotted list, a @code{wrong-type-argument} error is -signaled; if it is a circular list, a @code{circular-list} error is -signaled. For a char-table, the value returned is always one more -than the maximum Emacs character code. +This function returns the number of elements in @var{sequence}. The +function signals the @code{wrong-type-argument} error if the argument +is not a sequence or is a dotted list; it signals the +@code{circular-list} error if the argument is a circular list. For a +char-table, the value returned is always one more than the maximum +Emacs character code. @xref{Definition of safe-length}, for the related function @code{safe-length}. -- 2.18.0 --=-=-= Content-Type: text/plain [1]: https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00177.html [2]: https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00207.html Thanks, -- Basil --=-=-=--