From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#57548: Add new function `seq-positions' Date: Sat, 03 Sep 2022 13:16:32 +0300 Message-ID: <838rn0oj9b.fsf@gnu.org> References: <87edwtty5v.fsf@cassou.me> <83sfl9ob41.fsf@gnu.org> <87a67gubs9.fsf@cassou.me> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32537"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57548@debbugs.gnu.org To: Damien Cassou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 03 12:18:11 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUQE5-0008Ec-W2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Sep 2022 12:18:10 +0200 Original-Received: from localhost ([::1]:58082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUQE4-0004fU-WC for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Sep 2022 06:18:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUQDy-0004f5-Ex for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2022 06:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52323) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oUQDy-0004di-1F for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2022 06:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oUQDx-00068f-KE for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2022 06:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Sep 2022 10:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57548 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 57548-submit@debbugs.gnu.org id=B57548.166220022923507 (code B ref 57548); Sat, 03 Sep 2022 10:18:01 +0000 Original-Received: (at 57548) by debbugs.gnu.org; 3 Sep 2022 10:17:09 +0000 Original-Received: from localhost ([127.0.0.1]:41019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUQD6-000675-I4 for submit@debbugs.gnu.org; Sat, 03 Sep 2022 06:17:08 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUQD2-00066T-Eh for 57548@debbugs.gnu.org; Sat, 03 Sep 2022 06:17:07 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51484) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUQCw-0004ZJ-IK; Sat, 03 Sep 2022 06:16:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5h/xVx4xrSyahNPKeZd1AP+8nCRJ5DY4ZhW1eojK24o=; b=T6l4v6+9atNZ 1kEW4hvHpS5OcJyrsJnl2gUXrHwtC3GPyux1zRhTf2sBq160avEmvZR6kSdPbAl0kksC8BBoE5WbU RkOmb468RgEnJsh/gfpRsIxAL2MG+wjk8rCgnVoOGqqNILlReiWSrL9JFfwQD8zkrhOqJtgOjC1Rz BszNjXmlxwHl9TQh924lpdBrTZUExtqNsZJC4UYayCsTEwmCRXqHRMH0N4rjukW0om39WuXruvD1S 6J14IknQSD7TU6MjbP/WmFzhHgGQUDzMEQe7oHdik36TX9kqBuuz+Z7Pc7npr5Ung1LRCRb7ckgya GVW8qNVKowqnGMcRE5hflw==; Original-Received: from [87.69.77.57] (port=4945 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUQCw-0004MF-0I; Sat, 03 Sep 2022 06:16:58 -0400 In-Reply-To: <87a67gubs9.fsf@cassou.me> (message from Damien Cassou on Sat, 03 Sep 2022 10:01:26 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:241385 Archived-At: > From: Damien Cassou > Cc: 57548@debbugs.gnu.org > Date: Sat, 03 Sep 2022 10:01:26 +0200 > > Eli Zaretskii writes: > > We use "index", not "position". > > I changed the text in the manual, NEWS and docstring to talk about > "index" instead of "position". I kept the word "positions" in the > function name because there is already a `seq-position` function and the > 2 are so similar that I think they deserve a similar name. What do you > think? LGTM, thanks. > > In any case, the documentation should explain what you mean by that, > > I haven't found another such explanation in seq.texi so I'm not sure > what you means. I would be happy to write something if you feel > something is still missing though. As you changed the text to talk about indices, I don't think anything else is needed. > > Our style is to say > > Equality is defined by the function TESTFN, which defaults to `equal'. > > fixed. If you want, I can prepare another patch to apply the same > change to the docstring of the already existing `seq-position`: it > contains the same phrasing. Yes, please. Will be appreciated. > >> +(ert-deftest test-seq-positions () > >> + (with-test-sequences (seq '(1 2 3 1 4)) > >> + (should (equal '(0 3) (seq-positions seq 1))) > >> + (should (seq-empty-p (seq-positions seq 9))))) > > > > Should we test more than just one type of sequences? > > > The `with-test-sequences` call checks 3 types of sequences already as > far as I understand. Do you mean something else? No, I've missed that part Thanks.