From unknown Sun Jun 22 11:37:31 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#40570 <40570@debbugs.gnu.org> To: bug#40570 <40570@debbugs.gnu.org> Subject: Status: [PATCH] Alias cl-subseq to seq-subseq, define gv-setter in the latter Reply-To: bug#40570 <40570@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:37:31 +0000 retitle 40570 [PATCH] Alias cl-subseq to seq-subseq, define gv-setter in th= e latter reassign 40570 emacs submitter 40570 =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec severity 40570 normal tag 40570 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 05:45:59 2020 Received: (at submit) by debbugs.gnu.org; 12 Apr 2020 09:45:59 +0000 Received: from localhost ([127.0.0.1]:57378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNZBf-0000sa-7E for submit@debbugs.gnu.org; Sun, 12 Apr 2020 05:45:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:46917) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNZBd-0000sS-E0 for submit@debbugs.gnu.org; Sun, 12 Apr 2020 05:45:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42298) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNZBc-000649-5z for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 05:45:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNZBb-0000Pt-36 for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 05:45:56 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:40564) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNZBa-0000Pb-Sd for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 05:45:55 -0400 Received: by mail-lf1-x132.google.com with SMTP id 198so4398323lfo.7 for ; Sun, 12 Apr 2020 02:45:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZyaDtbDi8pNjZ9goeSzfAIM56Vt4va2hEqHbM03ySGw=; b=bbIbgoB9dOa2v1ZYrjRH+oIswl0F1gfaEHuEtOcvNfLyhl5sKAJwzSBxkgDpBnco18 JiudUa8peeZa4OFpsln4lrjsPPzMz+J2bfeXsdhGNvSF1kkjsHBTe6Zs1i9L8TG9gJWf VBUeoFbHeQHFnHf04ru+ugwnYpwFSW1ILjbxLmbpfghcfgeziNmU/0iM2QfNHXCWX/9F KXogHfzK5tmJBds5Q2vS0hbaOkbKlW8ybu0UUIOz7GhmoxF2yh3Yq+BAJa7HArWSPwpj 6VH7nDJ0Xru+5+VcUPFP0YpTANKBCibV/L9DLQNlLWuaKGgoLN+h6FjbvpUj5H/u2jpQ i+wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZyaDtbDi8pNjZ9goeSzfAIM56Vt4va2hEqHbM03ySGw=; b=hKyOWH+G4tYggfASL4s+tH7PwAJdYWrPai7LEYR6dVrIRpuBmlphptSc5jSra1jvFB w1GYJZuZI2Ds/2UAsxP7vOle+JV9lQ1n9V2obKbNOlkA7FVgt4kCsIXofSTPPc0jYLvN t8jgv6BaMXF7qk+Ih+OlLJukAa5F/mCbCnFzhPO1xV6UmuFg9u5VDU8Afunp1FdTfQT7 29FQHs47wHuJZxvd10zOeN3qURS+ACNWPcCJHpOo10mf798OPEufGgcR1JBy+Zc3Tyk1 zVD5+s7UE32W84FPF7Vz+loSZdUDaYRASNuIoCQY/jQgsolTZEmQ6GyFN9ng0uJfekKp vd4g== X-Gm-Message-State: AGi0PuYxDLtcKRMkojz+ZJK6avZFNtujGepDF7gAzgKOjWBtPbWKfmly UjfcbLc+6xuoXpg2ib/bnHBOOt4V X-Google-Smtp-Source: APiQypIn6lPvOhwmPod35+Y9zUSylRHFZFRAXkMW7jqHGLWWxzJqlmel4TR5MxU3WOy5LjrT6iUKLA== X-Received: by 2002:a19:2d1d:: with SMTP id k29mr7426377lfj.46.1586684752982; Sun, 12 Apr 2020 02:45:52 -0700 (PDT) Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id q4sm5615994lfk.67.2020.04.12.02.45.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Apr 2020 02:45:52 -0700 (PDT) From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= To: bug-gnu-emacs@gnu.org Subject: [PATCH] Alias cl-subseq to seq-subseq, define gv-setter in the latter Date: Sun, 12 Apr 2020 11:46:27 +0200 Message-Id: <20200412094627.2494060-1-stepnem@gmail.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-Debbugs-Cc: monnier@iro.umontreal.ca Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::132 X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The definition was moved in 2019-10-27T13:25:00-04:00!monnier@iro.umontreal.ca 0e4dd67aae (* lisp/emacs-lisp/seq.el: Don't require cl-lib.) already, but not the gv-setter declaration, so 'setf' worked with 'cl-subseq', but not with 'seq-subseq'. Moving also the gv-setter to seq-subseq and defining 'cl-subseq' as an alias of the former mak [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: umontreal.ca] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stepnem[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) The definition was moved in 2019-10-27T13:25:00-04:00!monnier@iro.umontreal.ca 0e4dd67aae (* lisp/emacs-lisp/seq.el: Don't require cl-lib.) already, but not the gv-setter declaration, so 'setf' worked with 'cl-subseq', but not with 'seq-subseq'. Moving also the gv-setter to seq-subseq and defining 'cl-subseq' as an alias of the former makes 'setf' work with both. * lisp/emacs-lisp/cl-extra.el (cl-subseq): Redefine as an alias of 'seq-subseq'. * lisp/emacs-lisp/seq.el (seq-subseq): Move gv-setter declaration here from 'cl-subseq' so that 'setf' works. --- lisp/emacs-lisp/cl-extra.el | 12 +++--------- lisp/emacs-lisp/seq.el | 5 +++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 5bf74792c0..2583fdb19e 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -538,18 +538,12 @@ cl-float-limits ;;; Sequence functions. ;;;###autoload -(defun cl-subseq (seq start &optional end) - "Return the subsequence of SEQ from START to END. +(defalias 'cl-subseq #'seq-subseq + "Return the subsequence of SEQUENCE from START to END. If END is omitted, it defaults to the length of the sequence. If START or END is negative, it counts from the end. Signal an error if START or END are outside of the sequence (i.e -too large if positive or too small if negative)." - (declare (gv-setter - (lambda (new) - (macroexp-let2 nil new new - `(progn (cl-replace ,seq ,new :start1 ,start :end1 ,end) - ,new))))) - (seq-subseq seq start end)) +too large if positive or too small if negative).") ;;;###autoload (defalias 'cl-concatenate #'seq-concatenate diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index e3037a7190..936c38283e 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -154,6 +154,11 @@ seq-subseq START or END is negative, it counts from the end. Signal an error if START or END are outside of the sequence (i.e too large if positive or too small if negative)." + (declare (gv-setter + (lambda (new) + (macroexp-let2 nil new new + `(progn (cl-replace ,sequence ,new :start1 ,start :end1 ,end) + ,new))))) (cond ((or (stringp sequence) (vectorp sequence)) (substring sequence start end)) ((listp sequence) -- 2.26.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 12:18:31 2020 Received: (at 40570) by debbugs.gnu.org; 12 Apr 2020 16:18:31 +0000 Received: from localhost ([127.0.0.1]:58705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNfJX-0004aV-FX for submit@debbugs.gnu.org; Sun, 12 Apr 2020 12:18:31 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:17710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNfJW-0004aJ-A4 for 40570@debbugs.gnu.org; Sun, 12 Apr 2020 12:18:30 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id AE81010033A; Sun, 12 Apr 2020 12:18:24 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 06953100311; Sun, 12 Apr 2020 12:18:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1586708303; bh=VpztlQ3v8hHaUPsBcLcBhvKVjwLfB1bCygKmlxfx2MM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=aSd3mYlyTz2wMYy+8VB0k0amSmQ1Dh6IasDWMAvKENAHHU3v7Z7P44To8UnFWZxjE kVva6qB6so2/pBv+JuvC56EipY9QGL8NpLOl3BXR1/+VwgaiTQYLoZBwbcwtL+1L86 QH1RVniejNTCNZQnKslECFEnugA4zClq4EkCNLV+3JAMNLgGSNC0m6SYW/2rrjvaJo ew6ft2KsfAR6GOF7SRZgALLxJQQWwn343+PnG4Lt4q67Ak5RxqEtU9HcthwS6O1fIq seqUoGzn9u8iuc+FPtzFGvc96WIIysT4ImfyiMb3PtzIJyIzzTmlWv0c1iKnrWWLD6 rK+9J7hyArQaA== Received: from alfajor (unknown [104.247.241.114]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C64D412027A; Sun, 12 Apr 2020 12:18:22 -0400 (EDT) From: Stefan Monnier To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Subject: Re: bug#40570: [PATCH] Alias cl-subseq to seq-subseq, define gv-setter in the latter Message-ID: References: <20200412094627.2494060-1-stepnem@gmail.com> Date: Sun, 12 Apr 2020 12:18:15 -0400 In-Reply-To: <20200412094627.2494060-1-stepnem@gmail.com> (=?utf-8?B?IsWg?= =?utf-8?B?dMSbcMOhbiBOxJttZWMiJ3M=?= message of "Sun, 12 Apr 2020 11:46:27 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.154 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 40570 Cc: 40570@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > The definition was moved in > > 2019-10-27T13:25:00-04:00!monnier@iro.umontreal.ca > 0e4dd67aae (* lisp/emacs-lisp/seq.el: Don't require cl-lib.) > > already, but not the gv-setter declaration, so 'setf' worked with > 'cl-subseq', but not with 'seq-subseq'. Indeed, when I made the move I just wanted to change the implementation but not the featureset (AFAIK seq-subseq never supported `setf`). So this bug report is fundamentally a feature request: make `seq-subseq` into a (gv) generalized variable. > --- a/lisp/emacs-lisp/seq.el > +++ b/lisp/emacs-lisp/seq.el > @@ -154,6 +154,11 @@ seq-subseq > START or END is negative, it counts from the end. Signal an > error if START or END are outside of the sequence (i.e too large > if positive or too small if negative)." > + (declare (gv-setter > + (lambda (new) > + (macroexp-let2 nil new new > + `(progn (cl-replace ,sequence ,new :start1 ,start :end1 ,end) > + ,new))))) The main purpose of the move was to reverse the order of dependency so that `cl-lib` would depend on `seq` rather than the reverse. This implies that `seq` shouldn't use `cl-lib`. The above `cl-replace` is hence problematic. Another issue is that `seq-subseq` is a generic function, so its gv-setter should also use generic functions so that it can also be made to work on other sequence types than the predefined ones. IOW we should probably introduce a new `seq` generic function which does something similar to `cl-replace`, then make `seq-subseq` use it in its gv-setter, and ideally also make `cl-replace` use it ;-) Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 13:15:45 2020 Received: (at 40570-done) by debbugs.gnu.org; 12 Apr 2020 17:15:45 +0000 Received: from localhost ([127.0.0.1]:58778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNgCu-00063q-V5 for submit@debbugs.gnu.org; Sun, 12 Apr 2020 13:15:45 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38551) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNgCq-00063V-28 for 40570-done@debbugs.gnu.org; Sun, 12 Apr 2020 13:15:43 -0400 Received: by mail-lj1-f196.google.com with SMTP id v16so6661269ljg.5 for <40570-done@debbugs.gnu.org>; Sun, 12 Apr 2020 10:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=TpP/rWwpNU1lNBQByICXDKs/LN51lAHBXA6N5iwLgLk=; b=hEn62XiGDZGHu0H9eQG7wGfj45EY2re8giQ1nPHH5omLG7jtlHgpzhvkWigvX0SJoM sQfnMNkdZe/upc2ggLu6cwZOJdU+fcS5pvQRyhRf8y3/ZzsGobRyHXsmfwsyCL9szE2Z 9Fj/6RXDGKvxPKt5Zld3rXJogSPrstP37xqaIvS+bJZFKLJAmjZEWR18QLzoRRPgZoiA HVU4WyecU+GxDLMS7eA7WO8qKMlp+D4YHaf9qo3dmXGX8gVgPINCQiiMeSi7SlekOTtD o5yeT1+9yFdtF/JHnfFpwpzfSO9skYLSq1a39ZV7EG4KNPsjwlevLkeQGPiGMZCWKlS9 Bt7w== 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:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=TpP/rWwpNU1lNBQByICXDKs/LN51lAHBXA6N5iwLgLk=; b=jCD1ddJIjNd6XUkfgxN/Nii46uk5BZK89jlxGFNMBsaOHba2vSqX+T2rmgrRh8NoTM /PySJLeW52nDyZWIb2iexEov98txgWEh1o9IOMKIdykKsdSKW+nlcPBIhW3r6S7uqSuK P0rCMrtDAHTJ//7ci4PuFLI3OBK4a5S4v95ssMuF/r9xOQw+Kf5JY9qi2c0W1bW+7Qm/ VaEXs4QiQqpnNHly8xKNreH2nchhLFsANkMikQcFav0lIDFYGczM2XnO7x8TUugJLpmu CMBCG0KAidLT4M9I+nV7G00WBFO3zW1XMQdtGTSM7RFTmFi8yNuJVxq4v8qplB5bJkEm DPtw== X-Gm-Message-State: AGi0PuaV6ZuQNYNsxrdkShw73VNq7aqgi3ckIt6AjiupqMvHRd+1qS3Y FK+bC+3eQp09os5U09QtYqU7O6kkJFI= X-Google-Smtp-Source: APiQypJLAJ+Pkx8qn5GZi/eN6r+t/Yh4LWrrunsdCaqqCkjalf8pqcj+8QAnuKmKq4CrhRGpUjNUOw== X-Received: by 2002:a2e:3603:: with SMTP id d3mr8559946lja.82.1586711734090; Sun, 12 Apr 2020 10:15:34 -0700 (PDT) Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id j8sm6300923lfk.88.2020.04.12.10.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Apr 2020 10:15:33 -0700 (PDT) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: Stefan Monnier Subject: Re: bug#40570: [PATCH] Alias cl-subseq to seq-subseq, define gv-setter in the latter In-Reply-To: (Stefan Monnier's message of "Sun, 12 Apr 2020 12:18:15 -0400") References: <20200412094627.2494060-1-stepnem@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sun, 12 Apr 2020 19:16:08 +0200 Message-ID: <87lfn0bp5z.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.7 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sun, 12 Apr 2020 12:18:15 -0400 Stefan Monnier wrote: >> The definition was moved in >> >> 2019-10-27T13:25:00-04:00!monnier@iro.umontreal.ca >> 0e4dd67aae (* lisp/emacs-lisp/seq.el: Don't require cl-lib.) >> >> already, but not the gv-setter declaration [...] Content analysis details: (2.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.112.167.47 listed in zen.spamhaus.org] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.196 listed in list.dnswl.org] 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: umontreal.ca] -0.8 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.196 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stepnem[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record X-Debbugs-Envelope-To: 40570-done Cc: 40570-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.7 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sun, 12 Apr 2020 12:18:15 -0400 Stefan Monnier wrote: >> The definition was moved in >> >> 2019-10-27T13:25:00-04:00!monnier@iro.umontreal.ca >> 0e4dd67aae (* lisp/emacs-lisp/seq.el: Don't require cl-lib.) >> >> already, but not the gv-setter declaration [...] Content analysis details: (1.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: umontreal.ca] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.196 listed in list.dnswl.org] -0.8 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.196 listed in wl.mailspike.net] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.112.167.47 listed in zen.spamhaus.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stepnem[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager On Sun, 12 Apr 2020 12:18:15 -0400 Stefan Monnier wrote: >> The definition was moved in >> >> 2019-10-27T13:25:00-04:00!monnier@iro.umontreal.ca >> 0e4dd67aae (* lisp/emacs-lisp/seq.el: Don't require cl-lib.) >> >> already, but not the gv-setter declaration, so 'setf' worked with >> 'cl-subseq', but not with 'seq-subseq'. > > Indeed, when I made the move I just wanted to change the implementation > but not the featureset (AFAIK seq-subseq never supported `setf`). > > So this bug report is fundamentally a feature request: make `seq-subseq` > into a (gv) generalized variable. > >> --- a/lisp/emacs-lisp/seq.el >> +++ b/lisp/emacs-lisp/seq.el >> @@ -154,6 +154,11 @@ seq-subseq >> START or END is negative, it counts from the end. Signal an >> error if START or END are outside of the sequence (i.e too large >> if positive or too small if negative)." >> + (declare (gv-setter >> + (lambda (new) >> + (macroexp-let2 nil new new >> + `(progn (cl-replace ,sequence ,new :start1 ,start :end1 ,end) >> + ,new))))) > > The main purpose of the move was to reverse the order of dependency so > that `cl-lib` would depend on `seq` rather than the reverse. > This implies that `seq` shouldn't use `cl-lib`. The above `cl-replace` > is hence problematic. Oh, right... sorry. > Another issue is that `seq-subseq` is a generic function, so its > gv-setter should also use generic functions so that it can also be made > to work on other sequence types than the predefined ones. > > IOW we should probably introduce a new `seq` generic function which does > something similar to `cl-replace`, then make `seq-subseq` use it in its > gv-setter, and ideally also make `cl-replace` use it ;-) Indeed. The definition of `cl-replace' looks like not for the faint of heart, also a lot of that impression comes from all the cl- prefixed args and variables. Is that just an artifact of some automatic replacement process, or is there a reason those have to have the cl- prefix? Or a conspiracy to make cl-*.el even more impenetrable? --=20 =C5=A0t=C4=9Bp=C3=A1n From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 15:18:27 2020 Received: (at 40570-done) by debbugs.gnu.org; 12 Apr 2020 19:18:27 +0000 Received: from localhost ([127.0.0.1]:58894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNi7e-0000cp-TJ for submit@debbugs.gnu.org; Sun, 12 Apr 2020 15:18:27 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:14108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNi7d-0000ce-FU for 40570-done@debbugs.gnu.org; Sun, 12 Apr 2020 15:18:26 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 469BB10033A; Sun, 12 Apr 2020 15:18:20 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 6F10A100311; Sun, 12 Apr 2020 15:18:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1586719098; bh=szCWYNExFw7zZBNJd2MIeqwgAB3b8/SpMV0jZmPJLvk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=l8wsqx/I+oCdwN/PqPp3gwAFeyWFVRP1ymte/3QGiGKkqWJD+5r7SFMjLAE5mk44/ dFwRgbfKsZ1Iv9qbMxoC4hSNLTM4tdCrgZtRwzQsRSJuesog6hza/ikzR5FvTz2Dfp SfPPZj1PxLeOC4gfRe/xZpl1GFzGr9mmNxkmL7ktJzkU0ppnRvARJwKHfcanhXtzSL gWKZU0BiwaOlZtVeVyttFVIXvvgq1B2KU8W1Wpu4/1HJlt4gEuYbz/nYuVqDdjAFjt 9Sky3ETcRwWKz9V9BL+HM/T7NS5zMYqXHFq8717YPYe+J4VmUBiK3EV2UCCdyrTyG3 53F2FRzdiAvbg== Received: from alfajor (unknown [104.247.241.114]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1572E1202B6; Sun, 12 Apr 2020 15:18:18 -0400 (EDT) From: Stefan Monnier To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Subject: Re: bug#40570: [PATCH] Alias cl-subseq to seq-subseq, define gv-setter in the latter Message-ID: References: <20200412094627.2494060-1-stepnem@gmail.com> <87lfn0bp5z.fsf@gmail.com> Date: Sun, 12 Apr 2020 15:18:17 -0400 In-Reply-To: <87lfn0bp5z.fsf@gmail.com> (=?utf-8?B?IsWgdMSbcMOhbiBOxJtt?= =?utf-8?B?ZWMiJ3M=?= message of "Sun, 12 Apr 2020 19:16:08 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.153 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 40570-done Cc: 40570-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Indeed. The definition of `cl-replace' looks like not for the faint of > heart, also a lot of that impression comes from all the cl- prefixed > args and variables. Is that just an artifact of some automatic > replacement process, or is there a reason those have to have the cl- > prefix? IIRC it's just a remnant of the dynamic scoping days where higher-order functions needed to obfuscate their local var names to avoid accident name capture. `cl` used it fairly systematically (not just when and where needed). IIRC I did remove this prefix in a number of places (and kept it at a few places where those vars are actually accessed via dynamic scoping), but I'm sure there are lots more to clean up. Stefan From unknown Sun Jun 22 11:37:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 11 May 2020 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator