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 19:52:26 +0300 Message-ID: <87efgfyomt.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> <87k1q7ytmr.fsf@tcd.ie> <83o9fjhvnk.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1530982262 13398 195.159.176.226 (7 Jul 2018 16:51:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Jul 2018 16:51:02 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 07 18:50:58 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 1fbqQC-0003Mg-AB for ged-emacs-devel@m.gmane.org; Sat, 07 Jul 2018 18:50:56 +0200 Original-Received: from localhost ([::1]:34360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbqSJ-0000XW-In for ged-emacs-devel@m.gmane.org; Sat, 07 Jul 2018 12:53:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbqRr-0000O6-MS for emacs-devel@gnu.org; Sat, 07 Jul 2018 12:52:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbqRn-00047C-P1 for emacs-devel@gnu.org; Sat, 07 Jul 2018 12:52:39 -0400 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:45210) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fbqRn-00046R-FO for emacs-devel@gnu.org; Sat, 07 Jul 2018 12:52:35 -0400 Original-Received: by mail-wr1-x432.google.com with SMTP id u7-v6so6889724wrn.12 for ; Sat, 07 Jul 2018 09:52:35 -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=u/xzCIG+sV+LBwW2FLXD2rpBevOzre15mV/jWPSYiKI=; b=ycZvGo1cpJwMF3BWj087W9jwIoPQMr7NxYzTW5ZU/YrXxuOTGYXqryGCtc5wD8RK7Y Klsly1ByLye5JIzMv2MGnr76E1tXFWdXCe/k/IQmve8WS+0CE6Y3phMQimmixRPJi83l CODMeW3h6L2wi9gmCyKlacNa1aevjQw+Km00LNy2H+VSvjmWqGA4chiKNwrh9JyQP4uy ZCfNmQYX0zETHDQfcQmsaS4yuM8Az93wOGWi9I7RfH6qirscBCkjlNnW3qk1LdeEGUvr nijBwaL2NmrzSu9vAbIN+FsJKCcIBseZYOX+4WXT2IFwvD37ipJznqMYixZEv3ZySuR0 zVaQ== 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=u/xzCIG+sV+LBwW2FLXD2rpBevOzre15mV/jWPSYiKI=; b=EHpDPPg9BsU0SXcAEzfAqXSoDMEs86qthDsyHSSTYeQIZIwGwuz7pndutadoYLjXqi iJ1EZ2cla1+QbN5jsk7iWaVwFZQfXXaTaDLw7ZZWsDxU1fDQbzqs6XTMBg5Z7Qd7xtBf C70dgt6g+0vn9m2y54qdwQpBypXUM4oowivIr3wbOdEUoN2Zt3aMdO+ONjpVwVS8eQer btMtXz4CVzckgiUOV46+7ns19/ZUwXk3Oskc8ezfS26hEPtV+rB4tvomkI4ispLTnl7w ECGu5Ah+Rf7jcnRsENShcCQzjKQO2t/ZGga87E2zvD01WutKv4GErIuRDgjfmB+wSIQ7 cdaA== X-Gm-Message-State: APt69E1iDbfWN3Tj7LqtUK1tYXdCgnt1oCDCK/9VxeJtPYECvRBVVJ5U mw5GvyfkOZ2dEpq4bNW3QtbgcA== X-Google-Smtp-Source: AAOMgpf3+ZiAFPZrCzcg/1drF341y32yM+g3D/E9Aqe78p8AMr43mDyp9zUYlTOvzm4i06PdZQHnAA== X-Received: by 2002:adf:dbc3:: with SMTP id e3-v6mr10112729wrj.217.1530982353865; Sat, 07 Jul 2018 09:52:33 -0700 (PDT) Original-Received: from localhost (adsl-44.91.140.91.tellas.gr. [91.140.91.44]) by smtp.gmail.com with ESMTPSA id d4-v6sm1574043wrq.79.2018.07.07.09.52.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Jul 2018 09:52:32 -0700 (PDT) In-Reply-To: <83o9fjhvnk.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 7 Jul 2018 19:12:47 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 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:227070 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: "Basil L. Contovounesios" >> Cc: Paul Eggert , >> Date: Sat, 07 Jul 2018 18:04:28 +0300 >> >> 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. >> +@var{sequence} does not satisfy @code{sequencep} or is a dotted list, > > It is better to say "If the argument is not a sequence, or is a dotted > list, ...". > >> +a @code{wrong-type-argument} error is signaled; if it is a circular > > Please try to avoid passive tense, it usually makes the text longer > and less clear. I'd suggest > > 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. Thanks, I agree. How's the updated patch: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-length-NON-SEQUENCE-documentation.patch >From 41fda89f5a161521dcc303e79f308b7c13a61b9d 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 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/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 -- Basil --=-=-=--