From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lassi Kortela Newsgroups: gmane.emacs.bugs Subject: bug#67580: 29.1; Anomaly in cl-destructuring-bind &rest handling Date: Sat, 2 Dec 2023 02:38:41 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6744"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 67580@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 02 07:45:31 2023 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 1r9Jko-0001Wz-Iv for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Dec 2023 07:45:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9JkJ-0000Ej-5o; Sat, 02 Dec 2023 01:44:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9JkE-0000EL-Pn for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 01:44:55 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9JkD-0004YD-NI for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 01:44:54 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r9JkM-0005yH-Qv for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 01:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lassi Kortela Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Dec 2023 06:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67580 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.170149948322897 (code B ref -1); Sat, 02 Dec 2023 06:45:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Dec 2023 06:44:43 +0000 Original-Received: from localhost ([127.0.0.1]:56543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9Jk1-0005x3-16 for submit@debbugs.gnu.org; Sat, 02 Dec 2023 01:44:43 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:50554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9E78-0007iO-Qh for submit@debbugs.gnu.org; Fri, 01 Dec 2023 19:44:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9E6s-0001Nf-VH for bug-gnu-emacs@gnu.org; Fri, 01 Dec 2023 19:43:55 -0500 Original-Received: from mail-108-mta179.mxroute.com ([136.175.108.179]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9E6r-0001GZ-2l for bug-gnu-emacs@gnu.org; Fri, 01 Dec 2023 19:43:54 -0500 Original-Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta179.mxroute.com (ZoneMTA) with ESMTPSA id 18c27f6a683000190b.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 02 Dec 2023 00:38:45 +0000 X-Zone-Loop: accd37755733454789d1f13c1426ab4c1a540048a7ee X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lassi.io; s=x; h=Content-Transfer-Encoding:Content-Type:From:Subject:To:MIME-Version: Date:Message-ID:Sender:Reply-To:Cc:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=5UwVaEo+HLSHioINACGHZOvO9V9Lw6wL1RKnw6Ar29k=; b=F PU87Tcw411mJ6q/36BELFF39px3/ns/enR9K0kkqPYcRbKcPnvlAwZQ3TS6K0z1MIRQeK8wm7pVQz kaCilmeYVMR2/kkMD6kV8JxwvAzzHS22Z03eOjVvseWUkoJ0I0CbFlWNcYQCnydhFUEs1XSQAzu+m u0zj+vOc2vI9wV2oUHFXotIKRUOnFNw83QvbUneXoSnRxgORAAQkW6Zru1JGUmHJSBYt2SCBeobuA MlIs6X2kTBZE4IWSLeFeE8Xre3liEX1ssg0AAxFE3a8QQj25dMK7gfaDg9lz3FBwu6UvkpaTUe6YH SQcx26BPOfWRYkjPXHa/dIR376uHel5cQ==; Content-Language: en-US X-Authenticated-Id: lassi@lassi.io Received-SPF: pass client-ip=136.175.108.179; envelope-from=lassi@lassi.io; helo=mail-108-mta179.mxroute.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 02 Dec 2023 01:44:40 -0500 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275352 Archived-At: ;; These three return the first value to which `a' was bound, which is ;; probably OK. (cl-destructuring-bind (a &rest a) (list 1 2 3 4)   a) ;; => 1 (cl-destructuring-bind (b a &rest a) (list 1 2 3 4)   a) ;; => 2 (cl-destructuring-bind (a b &rest b) (list 1 2 3 4)   a) ;; => 1 ;; These two produce the anomaly. When the &rest parameter has the ;; same variable same as a positional parameter, and there are at ;; least two positional parameters, then &rest tries to decode the ;; list tail from whatever value was first assigned to the variable by ;; a positional parameter. (cl-destructuring-bind (a b &rest a) (list 1 2 3 4)   a) ;; error: (wrong-type-argument listp 1) (cl-destructuring-bind (a a &rest a) (list 1 2 3 4)   a) ;; error: (wrong-type-argument listp 1)