From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#67116: byte-compile-let: reversing the order of evaluation of the clauses CAN make a difference. Date: Sun, 12 Nov 2023 19:32:23 +0000 Message-ID: References: <83r0kvv6r0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21709"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "67116@debbugs.gnu.org" <67116@debbugs.gnu.org>, Stefan Monnier To: Alan Mackenzie , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 12 20:33:40 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 1r2GDE-0005Sg-EP for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Nov 2023 20:33:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2GD4-0006o1-IQ; Sun, 12 Nov 2023 14:33:31 -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 1r2GCy-0006hd-70 for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 14:33:24 -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 1r2GCv-0005AP-K0 for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 14:33:23 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r2GDa-0007MS-6u for bug-gnu-emacs@gnu.org; Sun, 12 Nov 2023 14:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Nov 2023 19:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67116 X-GNU-PR-Package: emacs Original-Received: via spool by 67116-submit@debbugs.gnu.org id=B67116.169981760428250 (code B ref 67116); Sun, 12 Nov 2023 19:34:02 +0000 Original-Received: (at 67116) by debbugs.gnu.org; 12 Nov 2023 19:33:24 +0000 Original-Received: from localhost ([127.0.0.1]:57039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2GCv-0007LY-Mr for submit@debbugs.gnu.org; Sun, 12 Nov 2023 14:33:23 -0500 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:19216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2GCq-0007LM-Mh for 67116@debbugs.gnu.org; Sun, 12 Nov 2023 14:33:21 -0500 Original-Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ACJVdSC032319; Sun, 12 Nov 2023 19:32:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=3FxGpEvDdIWw9qWLaHo821uh1Gda8fr6bTU8VMMzHCY=; b=2kHD8XtbrKgx2V8W0/ZBxN5FRDlbBs3hbWU8MHkkj+AGTNdyBF3w/9VQ50dMTSwF7eeK t8vgKwT23v1ff0L37fdTjUNCabF2DioU3l3SP9Ja1T8NsVCGtbbDaeqHJGFUWOHA9drq 9ymUJ4I4PDpZdKwAsP1CIgv+ZhBHIjaS9V1CxpKoasnsPfBXRbMNMdbJfzm0PqeKE0F8 dSp4PNHUjeGbz5MJxQ2YwZlRFN1XjP6i9eo04k6gTGlmwSvksZIH5DLty8W+QbcI2SYX 8dkO9DdfgCqzIvUScreeUPq5efL3PS5JI7r3ajkg6dI1i9QlTyYF0Zk5WYOBCc/1c+LH LQ== Original-Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ua2mdhp56-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 12 Nov 2023 19:32:34 +0000 Original-Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3ACH0KUq020759; Sun, 12 Nov 2023 19:32:33 GMT Original-Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3uaxgxxjvf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 12 Nov 2023 19:32:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Otxzge/RMIvWhqyAg5OvEvYSkarvD1t7YP6H6B+BBVXcwfwO+b0oqx/GNtLC5KWtR9tTV6EWLeh/thftGYKXCDsT6eXTbDngU72BuuYEDL8Cu8asmMzhlNi/YyAO95c8IahY87vd2q2nwLV1fOz101UbQxhQh3bCJBs2sNsL58OxkO+LSXyra8zahActdawDWC8XQgw4zZ+83J86jYNGG8ggYTFCgvvPj/SgAS84NP9lnNefdshYjf+peUsGlkbKOH/QNc6ACITC6t0u7NCiifYotVuU8aiyKa9cZgfRsMq5jhuiKx3iok1QgM0OLt/FJeB3u0cof8D4zMBlVgu1EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3FxGpEvDdIWw9qWLaHo821uh1Gda8fr6bTU8VMMzHCY=; b=CdrmRfNIn59ahXEeZb9mjBnnFX9kjbEYvUg/nwnUhDUUsEAWQpeV6GcBg7sWOeuEYa33rZJ3MC4lPeDLqbCFPSIq9QBMZb+9OzzPPCty5FLbrLVx8HFl9yu2hg6LEgJ+vFwJlbrI/bZFaKVq4cOJ1wTCkbAzm+J8152upfYRIZeRBMAib+oZOucvrjeMqHn+a+UUn+xVqL74rcmRtCWozKXIJJx4b48Npil4C5ioKBhHkZWNB9gEYZLAdUietl7tEJHbPqQYJOyyJvkUPSdcIYyHxlCCMfPDw0YlI1DlgSs/hmRwoeA9J6tbmasaitTvPUwl/wzWirH2xkpGwiGavw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3FxGpEvDdIWw9qWLaHo821uh1Gda8fr6bTU8VMMzHCY=; b=UCp9SgqA/RAvNsz10uuF7iJQaCY0Imv/RJP3/G2UdTePeNc+RRk9MUlb32B9ldPyWe9N09WA9cLofE+eonxP95mkWn8jd81EMmCNXuV6Y5xNFI508bVxqWwD1/R+tnXv9fAJBwgzEi9qVc4A4khZgqKkCK6X3+rb7E7aT0yrRN0= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by CH0PR10MB7535.namprd10.prod.outlook.com (2603:10b6:610:187::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.29; Sun, 12 Nov 2023 19:32:24 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::3b4c:a669:c229:47b4]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::3b4c:a669:c229:47b4%6]) with mapi id 15.20.6977.028; Sun, 12 Nov 2023 19:32:23 +0000 Thread-Topic: [External] : bug#67116: byte-compile-let: reversing the order of evaluation of the clauses CAN make a difference. Thread-Index: AQHaFXPYkuQlM3X6PkGhmXnLd7W0bbB3Elug In-Reply-To: Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|CH0PR10MB7535:EE_ x-ms-office365-filtering-correlation-id: 49fea385-9444-4239-e82e-08dbe3b6182c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: U7lFyIFx+3c4V22GWD4NTAyFwzymvmibh4sOK58rE8oRMQTCPut3z4sKCDDxRbBWn0kj4xetWWCp8lt89KSckh8WHpYb7CFgTBB0/2/OgkDN3N3h/1+6JDarFIh5Tob4/Kz8aMGlLx/UMDy+sZXNtsmVOV8KOx7DWOrzRr5S0Y7D7z7yVxBIrzFjSxreR5nwvmMeKukxWWVKZqKUl5FHztiCkQIYR0IFndAvRy8BL3ReHhe6+o52PZZ5z/xrd1w02NyRiEd1PByLaqWYox/rPwPRAbgnotoUNw0Y8ZAcbKwhC3gW/LrRn6KifSTtDWaOZDg3ulU9goM6AIId/ZvCRNv3bXj9aK7+21KH6OfPQW9QjpOAu6sX11OMTTTPidpYDXLJ5L61Pwn0qEdooP7+xmOOPtlkr64r2l397xz8rKeunvEGFFJNmB9KFd5v1CZtrm1VLkRLktqU388md0EgTu4FJg+Q+VAMtv9ctbIWJL4zMozFdiIUk3FnZMZWwGZDqacbkUiKMRWLW1StzlsKKtxoL+qqz2EEUh9u1Tv1f0zlLTU7rtHOKVyfX7lI6Bv7FRpe8IHlQk6qD8L+Nvsy7UE/918fe8VH/VIm/BXc3Hi4K6GbWavSSw8tGMQNwHbp x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(366004)(376002)(346002)(396003)(136003)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(26005)(6506007)(7696005)(71200400001)(9686003)(83380400001)(44832011)(5660300002)(4326008)(8936002)(8676002)(52536014)(41300700001)(2906002)(966005)(478600001)(110136005)(54906003)(64756008)(66446008)(66946007)(76116006)(66476007)(66556008)(316002)(122000001)(86362001)(33656002)(38100700002)(38070700009)(55016003)(154513002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: VdkfYYWsTPw6BaU9du4DaEL8N4ydP1NdVzRr78Zua1VLJA1nG2kfEh0+LaKVoK1cTk2WBd3eL4ERk3jtoXzLoNwgPvHEd5PdAvbMtT3SgyrOIGm7MFd3VK9bgNQdQSriyCB5PYDG3n1jfCoO5qe+1q0j6sLU16j4MhGXWUDwZoPv7y4qAtuT0eLFII7HNqoLVh+cxh8p1dfCvlJXiJRzjBitKE34agfAaJsom4nxK34peH7zzdSdcg92+2F1FlRuWOwkDd6zA83IEUNV3/Bzx3b7uGhpdFwD61sMAkI9ryD593EkkoEbbdNSsQCi+DDTiTuscjIG/J8qlXXNWzQCFvaMjpqCK+JDwBWxhpfyDvcNtXz7Qglc+KjMr5pf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WGyKdIX/Uo0RY9sdeGg0Ts7WdEvYrwUpp65GISVQ5qmZI85SqaFMSvSqmqrrKE1OpOoAxHw9TLN+GEQF5ud3TC/YuRYUF52W7lJasItz+vYRHQCI7e2G7+LCKNKQgVrJo5t3BB3IIoYd2DQNg81A9cHQP8+futgIi09lDbK9iPz2WiHlhJu+gQrokZwogT/p7dokQicesqfiRm6p7pB/g94l6A96ElDYFNNtaHbzO v6RWwwoLqQyUiuQFw5uS9uV4lwhpqFxzE7IOqyTxiEksDtubkN6r24hpNgJnmu9+2jVBmKkm3MzVy8U50coHienDE6XNIIbUZ0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49fea385-9444-4239-e82e-08dbe3b6182c X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2023 19:32:23.2072 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: AghM7arvzyJj4k4GiWjgzF7oRZZAepJXNRYGIq4rKyT9+Mn07SdF/94bK7XHqn3Kfok/7Z28nrsyHJALXRs41w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB7535 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-12_18,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=537 adultscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311120170 X-Proofpoint-GUID: 0qldofGyLEL7tIwG_6OhYd_ssRwdbUhU X-Proofpoint-ORIG-GUID: 0qldofGyLEL7tIwG_6OhYd_ssRwdbUhU 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:274221 Archived-At: > > It does? I always thought that the order of evaluation in a let form > > is unspecified, and in practice I had several bugs of exactly this > > nature, which I fixed by using let*, as expected. >=20 > No. The order of _evaluation_ is specified as top to bottom. The order > of _binding_ is unspecified. Quoting from the elisp.info page "Local > Variables": >=20 > All of the VALUE-FORMs in BINDINGS are evaluated in the order they > appear and _before_ binding any of the symbols to them. >=20 > and a little later on the same page: >=20 > On the other hand, the order of _bindings_ is unspecified: >=20 > > Why on Earth should we require any particular order of evaluation in a > > let form?? >=20 > To make the value of a form unambiguous? In any case, we do require a > particular order. Yes. And FWIW Common Lisp does the same (which likely means that most other Lisps at that time did the same). first evaluates the expressions value1, value2, and so on, in that order, saving the resulting values. Then all of the variables varj are bound to the corresponding values in parallel https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node83.html