GNU bug report logs - #76472
nconc should fail for dotted lists

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Pip Cet <pipcet@HIDDEN>; Done: Pip Cet <pipcet@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 76472-done <at> debbugs.gnu.org:


Received: (at 76472-done) by debbugs.gnu.org; 21 Feb 2025 18:03:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 21 13:03:33 2025
Received: from localhost ([127.0.0.1]:35095 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tlXN7-0001tR-2e
	for submit <at> debbugs.gnu.org; Fri, 21 Feb 2025 13:03:33 -0500
Received: from mail-4316.protonmail.ch ([185.70.43.16]:42595)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>)
 id 1tlXN5-0001s8-7S
 for 76472-done <at> debbugs.gnu.org; Fri, 21 Feb 2025 13:03:31 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail3; t=1740161004; x=1740420204;
 bh=iv+c8RsrrY7VXAHQhSRVUWLIulhY4FnCGJgz6XguVEM=;
 h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:
 Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:
 Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post;
 b=T/8v/HsU6NHFjiq/w3mND6vuqoSbtwCZNp78+6mT62WaIXAFuwytdm9VGoDyecatU
 Zj0I79idxyDkrwP2XPfDkTI9KtdA+0+SW/IK2pt4IC55UvAMKNq48M9BmxJPu/lKxg
 FlLEiXXs30DOwUxcEft6V5L9q4NiLVEWdkZhgpRcEgETkwj6zURF+bDqZCMAVLR8Wz
 C6I1BilxyqMre9Y2YkajcTe34yFFfeH1viFjSrjb01QKQnagzYcC0PwuxpxK8XeO3a
 vRdOi7VmH1GFNfJYTSVBygIksx9pYRInajTRmLJhNy8N79YOxx/tBVcPRcrCY7l0h+
 eKYYyXJCVGLHg==
Date: Fri, 21 Feb 2025 18:03:19 +0000
To: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
From: Pip Cet <pipcet@HIDDEN>
Subject: Re: bug#76472: nconc should fail for dotted lists
Message-ID: <87h64nrx9v.fsf@HIDDEN>
In-Reply-To: <424DAF20-42EB-42BD-8151-F2D6633F3329@HIDDEN>
References: <424DAF20-42EB-42BD-8151-F2D6633F3329@HIDDEN>
Feedback-ID: 112775352:user:proton
X-Pm-Message-ID: 767d082211b4da09d3cde547eb737b31ce4f0fae
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76472-done
Cc: 76472-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Mattias Engdeg=C3=A5rd <mattias.engdegard@HIDDEN> writes:

>> The current behavior is: (nconc '(1 . 2) '(3 4)) =3D> (1 3 4)
>
> Actually that is probably intended and completely fine. It's what
> Common Lisp defines for this operation, and I don't think adding a nil
> check would be an improvement.

Sorry for the noise, closing.

Pip





Notification sent to Pip Cet <pipcet@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Pip Cet <pipcet@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 76472 <at> debbugs.gnu.org:


Received: (at 76472) by debbugs.gnu.org; 21 Feb 2025 17:25:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 21 12:25:35 2025
Received: from localhost ([127.0.0.1]:34540 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tlWmM-0004Rv-Lj
	for submit <at> debbugs.gnu.org; Fri, 21 Feb 2025 12:25:35 -0500
Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:46245)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <mattias.engdegard@HIDDEN>)
 id 1tlWmI-0004QF-Qp
 for 76472 <at> debbugs.gnu.org; Fri, 21 Feb 2025 12:25:31 -0500
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-54527a7270eso2370721e87.0
 for <76472 <at> debbugs.gnu.org>; Fri, 21 Feb 2025 09:25:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740158723; x=1740763523; darn=debbugs.gnu.org;
 h=to:date:message-id:subject:mime-version:content-transfer-encoding
 :from:sender:from:to:cc:subject:date:message-id:reply-to;
 bh=SQiOS62JEaXm0mlmrYfNaMxEPw64iSlmYJgNyadFCos=;
 b=CJ6VUSzWxC5RFEzraEdaIyuvCCpMN0lXC1LnLhVNz52sfu8VCGYtKTDz1yrxxBpDa+
 0f4ppuJJpvsknVayUlXTwwzK1gHiuYiZBSvBhAS8I20O53uUUx7301c6zfEScTDmQTJb
 oPxaJvr/fnWFGed8G7BbTz95QeN5/u9nbM+I9Wc+fWG1isW2ikc4KaRot3hcu+6rpPmA
 EcFrkGFenpt6BykwYjfjCbpc7oxouO5s5J7ah0tl5264NU5YDe81csAUtHr+Q+7tUAAC
 ClI+J1c3CWdFD3ityL6hfJNE9ggmcmagvsSM6+O/I6oRiovpbjwBpLsyAqPu5aey+fIL
 9p2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740158723; x=1740763523;
 h=to:date:message-id:subject:mime-version:content-transfer-encoding
 :from:sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=SQiOS62JEaXm0mlmrYfNaMxEPw64iSlmYJgNyadFCos=;
 b=d0G9JpkUEcyQg/BjUhow7ELx1p6opVwe5Ao8W28NgaZaYw0BqW368Y7NZOroRSsF6v
 HTkhGCj/YDrjMa2n5Lz7fZ/XuVu3M3aTuFEXd0mXJZ+BqZ60asO6ofOx3Q5MxgMirehv
 25H0HVX/bSUUu6QUtFeev/sMcu8h1h2kKj8FaQbdE1/zSJ1MDBqZnJOshOEIKNBjahoQ
 sUGN1e3GW3CvzOqesHm5DigVGaDFOC+RAVIKi2+zp8z5CqOVq3tgGVTX5NohmFx1pZ7j
 R9IY9DjepZS4GpFWmlu61EWMh7f9ObWk3+KTgDMGlXTHNTnUKrLHvC8LVHWrV70pisAy
 1FKw==
X-Gm-Message-State: AOJu0YyhrJAUh5fLJtvEIC/jOrECwhtSgH2Dx5ddU0ZRJBTf7XX0DFot
 ZOCtEF8cYQfkn9cB4909cqs/EY+34IckGz577wJCwe3b/ByNTcHuh1IypQ==
X-Gm-Gg: ASbGncuwmekWduXNGKs9GQaKGGu4Vy/F2EAZ9sJzw8nZB10NSx4VZ963DlpLes5fMPE
 x/+7I1mMsqm2cMGI/UGamOPi8qNPSwoqusnzG287dxtpUSOwwpneiCymsFZBYOzax1zm5bIwt38
 o03CP4LxQz8NPamvrzFplcImX4KvD0apd2fpq//ycVRnuFNC0qD2VvGu56ahiFFXau/1wMObWsX
 zBIo8+qvmparIsg9kraF+frCzbywnrHi54bgB1hwGpNdM8xlRUze7A93timSrNEvLkitK6xKLkM
 sBz9yx0uvgp7MQ6Zdtz0VU0t1c/M7FMLUlKheEQRbQpZUgvI7X9LVCg2U0WZaU4sQXS7F6AqFKX
 hUjmQEOreB7hTjddb
X-Google-Smtp-Source: AGHT+IHRZq8AVFcj1c95F89ZvUumpM3Nhnc/Kk8Xbxd40HF9lnkt7EJSFxftIdDLWbC0tZI59etV7A==
X-Received: by 2002:a05:6512:138d:b0:546:3052:4202 with SMTP id
 2adb3069b0e04-54839147f79mr1795600e87.27.1740158722412; 
 Fri, 21 Feb 2025 09:25:22 -0800 (PST)
Received: from smtpclient.apple (c188-150-186-155.bredband.tele2.se.
 [188.150.186.155]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5461d064a3asm1795885e87.158.2025.02.21.09.25.21
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 21 Feb 2025 09:25:22 -0800 (PST)
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: bug#76472: nconc should fail for dotted lists
Message-Id: <424DAF20-42EB-42BD-8151-F2D6633F3329@HIDDEN>
Date: Fri, 21 Feb 2025 18:25:21 +0100
To: 76472 <at> debbugs.gnu.org,
 Pip Cet <pipcet@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76472
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> The current behavior is: (nconc '(1 . 2) '(3 4)) =3D> (1 3 4)=20

Actually that is probably intended and completely fine. It's what Common =
Lisp defines for this operation, and I don't think adding a nil check =
would be an improvement.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76472; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 Feb 2025 14:15:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 21 09:15:18 2025
Received: from localhost ([127.0.0.1]:57770 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tlToE-0005E0-7e
	for submit <at> debbugs.gnu.org; Fri, 21 Feb 2025 09:15:18 -0500
Received: from lists.gnu.org ([2001:470:142::17]:51776)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <pipcet@HIDDEN>)
 id 1tlToB-000589-80
 for submit <at> debbugs.gnu.org; Fri, 21 Feb 2025 09:15:15 -0500
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 <pipcet@HIDDEN>)
 id 1tlTnu-0000x3-JJ
 for bug-gnu-emacs@HIDDEN; Fri, 21 Feb 2025 09:15:01 -0500
Received: from mail-10631.protonmail.ch ([79.135.106.31])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <pipcet@HIDDEN>)
 id 1tlTns-0005yD-C3
 for bug-gnu-emacs@HIDDEN; Fri, 21 Feb 2025 09:14:58 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail3; t=1740147291; x=1740406491;
 bh=Q0cM6Q8lM/Dhfawbr0xnKBwA2EpiQVtf3Jk+3zZ6mpc=;
 h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date:
 Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector:
 List-Unsubscribe:List-Unsubscribe-Post;
 b=eMsVJx0VID5k+CgIueP4DCmlLJBKkEO8HTJcIHjSkXifVMhpuowT+vrtjVw0gQ8L9
 6knVqH2LV7SA5prf2ajdx8xSqv4IwryOEdC03BUdGHq1Ya0gylXUHXAccZrwpvVBq3
 jkDlJExwiwFAOhoTGhSbGrGTfBAAf6P34Z4K9VETpshW1dQtx0lf7EuESAbQfeOqeb
 WwXX6vGr2SW1U4rd/qnkoCg2YNKGz0gOW3+jqyDLLNGZK5tKbnquTJcjQL/89kVO0M
 OgyY4d+VDtaFTS9+XVm0hOf8ebdH+IsAst0JO//mKm+d6q3Siqm4LHKAIhfrS+dN7N
 egFYsRWFEHFpQ==
Date: Fri, 21 Feb 2025 14:14:44 +0000
To: bug-gnu-emacs@HIDDEN
From: Pip Cet <pipcet@HIDDEN>
Subject: nconc should fail for dotted lists
Message-ID: <87y0xzs7uv.fsf@HIDDEN>
Feedback-ID: 112775352:user:proton
X-Pm-Message-ID: 11dea0240c0a2b84cdd99288e5eedce39dacc453
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=79.135.106.31; envelope-from=pipcet@HIDDEN;
 helo=mail-10631.protonmail.ch
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, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

The current behavior is:

(nconc '(1 . 2) '(3 4)) =3D>=C2=A0(1 3 4)

This doesn't seem to me to match the documentation, because the cdr of
the first argument, 2, is discarded.  'append' signals in the equivalent
situation, and I think nconc should, too:

From 285a30392273552503fa6d66bf7a9bdb472f6a8e Mon Sep 17 00:00:00 2001
From: Pip Cet <pipcet@HIDDEN>
Subject: [PATCH] Make 'nconc' signal an error for dotted lists (bug#)

* src/fns.c (Fnconc): Call 'CHECK_LIST_END' for all but the last
element.
---
 src/fns.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/fns.c b/src/fns.c
index 0ba8e42a60f..720ddb666ca 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3354,6 +3354,7 @@ DEFUN ("nconc", Fnconc, Snconc, 0, MANY, 0,
       Lisp_Object tail UNINIT;
       FOR_EACH_TAIL (tem)
 =09tail =3D tem;
+      CHECK_LIST_END (tem, args[argnum]);
=20
       tem =3D args[argnum + 1];
       Fsetcdr (tail, tem);
--=20
2.48.1

No indication in the git log that this behavior is intentional.





Acknowledgement sent to Pip Cet <pipcet@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#76472; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 21 Feb 2025 18:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.