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.devel Subject: RE: [External] : Re: Instead of pcase Date: Tue, 12 Dec 2023 21:36:48 +0000 Message-ID: References: <87fs169mjj.fsf@posteo.net> <093f11a1-57c2-5e56-d39b-26fef1c67cbb@gutov.dev> <25942.25061.217864.329049@retriever.mtv.corp.google.com> <87zfzdcz6z.fsf@posteo.net> <87zfza2aq2.fsf@web.de> <7nmsv9zq6u.fsf@ecube.ecubist.org> <7nv89x5tsi.fsf@ecube.ecubist.org> <87o7focuf5.fsf@web.de> <875y1r10jr.fsf@web.de> <87v895iyzy.fsf@web.de> <87fs072phd.fsf@neko.mail-host-address-is-not-set> 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="11097"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: Tomas Hlavaty , "rms@gnu.org" , Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 12 22:37:50 2023 Return-path: Envelope-to: ged-emacs-devel@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 1rDARq-0002g3-0T for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Dec 2023 22:37:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDAR6-0008S9-Qd; Tue, 12 Dec 2023 16:37:04 -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 1rDAR3-0008NO-MA for emacs-devel@gnu.org; Tue, 12 Dec 2023 16:37:01 -0500 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rDAQy-0001Bf-20; Tue, 12 Dec 2023 16:37:01 -0500 Original-Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BCJhwG8020799; Tue, 12 Dec 2023 21:36:53 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-11-20; bh=7Hp0gG5+RgqX6UmiDdiuOEaH67EV1x61D77o2S2H8WA=; b=mT+C68eERepub0CJXTFSfp9/svN1siim7k7K1/JYciGLniPoS9XagGFlUWhyjhI9BJHq 3RKjD1FGQlZrUZWdGELnNWZsYR8W5YbraDUqFnpusHJ1cDtTQWbGASJf5XKATWXCF7aV f0rTNBO4HOPH4o0OIcyXZmB2qWVLjveeYx05epUhrDvBl2WMNQIuuFySmHRM8yjJIuMq 3XdfehJmPLUxuxha0Mcv+9/QlcewXRwfh69ZB/RkuPkzy+dTBAY7N/Bx3Nv3Q1m+Sss3 cEMizMj5OsqZB8+H4x03Z2/+KnsQfCuQbewpP7igS9Fkbhsm57DOrEPtE+0vdzKIzCE+ Kw== Original-Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3uvf5c6t86-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Dec 2023 21:36:52 +0000 Original-Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3BCLZZoJ009884; Tue, 12 Dec 2023 21:36:51 GMT Original-Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3uvep783sx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Dec 2023 21:36:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QwVN1u+MTxiNQOAIi1q0VUZyvw7xvNjXl8B3d/ljCsmEdTDO9YBawik53VhCbGW2IYlkGNuyM5wLR7FMJeGmd5XwnwmsaoY4VoUMLApRzyD/HshdE6Lbeq6hQl4ZJt4P1chaV2ozD+tlKQ1qIAs+nQ3m+A5oWs4jytkuQKNkAh8Efpz7hA8neModtxxC3Xq1qK4+T6CTxt5t7B+GmFjVd+rpD3IBvjccu8Sgitkn1xmWJ5h+DMpX37nOxQqjSoNnpl2PZIWfRV5TTn3exfHmQOynOMJnu7umrAH9rxZKfJfk3XWwu3zC5Tjp1YxbJR0CzMMzDEcAxmaP68erz5BYaw== 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=7Hp0gG5+RgqX6UmiDdiuOEaH67EV1x61D77o2S2H8WA=; b=iecs/DLLauzxgDm8BA3fDOapidiYeuUsVzVfNi6gtEJwsCFLMj6nIYBGKw6OmRpGErfLcDRYuVs+PlS5V1a4Eu5Yn/iAj3oSE6cREqJO+uMwdgB3Hh+7ZfgM1U6Xp3mbzh5kD3I6x3o1GG0waJnEOuZbPQcUn4lZFF9L9RK/gh5fVnmBVBRg/4lM+drM6KBTmuoQJleAondK7iFnC+a+jUIjUDjVJs3qLneF0OAxmUIZjpGn7ysx6BlyxUz26uNcKgsGwmW4boFZOXeB2DGIyoib9qZbz/UmnH79k++uMaajUMHmkHQgctIEHDtlQ1i9+fOetPio3uNM7hSS8+YhZw== 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=7Hp0gG5+RgqX6UmiDdiuOEaH67EV1x61D77o2S2H8WA=; b=pZth+CWurr63vdCNYkopR95oA0BVKSicP7KuvpjzGiLCU89RfrlaNjMqKcPlGWZRhEmv5k8eGXVeyO54cZohN8gn94sDgX8MODwEdB5/3o2gVUKhaMOIBrIzjSUJSYzyEuJMeWiJC8inzq56LNxVC3MjKJgeTd9H+otxYl7S/S4= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by SJ2PR10MB7109.namprd10.prod.outlook.com (2603:10b6:a03:4cd::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Tue, 12 Dec 2023 21:36:49 +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%7]) with mapi id 15.20.7068.033; Tue, 12 Dec 2023 21:36:49 +0000 Thread-Topic: [External] : Re: Instead of pcase Thread-Index: AQHaLTD5fIQbCjMt+ESE7ve333vQYLCmKdgA In-Reply-To: <87fs072phd.fsf@neko.mail-host-address-is-not-set> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|SJ2PR10MB7109:EE_ x-ms-office365-filtering-correlation-id: ab14ea92-a5d4-4e4c-47d8-08dbfb5a7289 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NX3jgxA6Gn6lwfrROHGNRRJcJk7x6gTQwIKhWogAKd0rf9RP7MTrlBui/aqysDESq06KtlIF0bc7MAQJFT0BkCOAVHov/SsL4x0aHs05R5hgO+J0T1xBprr/wi+Wn61vQj5PjZwHtxho0T2fby6l+IYv1Ox9f/g0vR3K+WB1vr+yPxIbWGxNvaSKDGK8JtQLUzwBdg0iUxx6cCEffrskm8ttMDp/dZDhT+/fsIdx92hRKQs+1td2EoCXF2VR0JOoXr+fGjlov5XWVpYEIX1SIwLbu6nSVarQsqAbv7D7fnFwe/GxkM9NA9xgg3xwKCgAavoEPnXC3RUv6db+lUGyerhvQYTI909b1Kela0ZqPL33p5fr3e7KL05LhJ3hKMlYFqKBeOED3nOSyfC84mKqfUZ+dUhQ+WgAhG6PJeMFewcDSwN6QwpqQgABxpTaamzsXpKImMdNKYz+2263feKtnPVNXnZ58nJRsFB6OB9OqHNWIHaX0iZCH/vMXFLE/zC0z1k5Mh14FRhhV47wB4SfIsWz3jmGa6Q2I+3aIaX97Al0EBs7YaSsfDlSerHf9Lg4eYMRjNdTKUUFbrBl7T4Qoj2BWYe/XHP0muKDPHYUVXE426vm2G9AJaJIBUJOrGveXd4hvTRrK9nzoeBZ0dqJsg== 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)(136003)(376002)(396003)(346002)(230922051799003)(451199024)(1800799012)(64100799003)(186009)(6506007)(7696005)(9686003)(38100700002)(122000001)(8676002)(44832011)(5660300002)(4326008)(8936002)(52536014)(26005)(41300700001)(2906002)(71200400001)(478600001)(316002)(64756008)(66476007)(66946007)(66446008)(66556008)(76116006)(110136005)(33656002)(86362001)(38070700009)(55016003)(21314003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7jGvN1G262gbGQGxm/zOG6VSOWre62NTZL9C6wyk+fozIAQx4j9cfiEBhdZW?= =?us-ascii?Q?noAU1RgY/XQgE7KYCl3pduJ+WA8zKJsIm7V4pMq1naqzFKwphcLpPi86Irht?= =?us-ascii?Q?Qm/iRHJw104Rnag5uARMqqcj5tLxbzLKxHKB2jnowGM2I/a4BNusrI95g4kQ?= =?us-ascii?Q?KDAFfSER/PuH/hs2Im/At+qVXL8nO3yO2qaju8kiSSLiKNH2+4t8g/kZJQJQ?= =?us-ascii?Q?gRyXAVPVwam1+7KbxoKupE2zc5d27+5cEawg0GCzMzpYIX5ZZPW1615i05z0?= =?us-ascii?Q?vnu8Oq1Bvds1snyvWT5oB45T1jDWzuAfjRxmOzMFcIrHHg8kxatjJbXFHZzi?= =?us-ascii?Q?ohp/8WWqSmV+wPnDutkpcfAcumEOfWczNviOCWf413Uoyri+9Onsl5rHAZsg?= =?us-ascii?Q?GEVd/goC9pdMk5Zgfo+LvBPNYGqhRp4jdnY1wsJq+20K1YHe5IB2J1VAcrJy?= =?us-ascii?Q?uuWTZOycj9EHjawzOjMh7/2LhKfh4dfmt7grNAWhNsZ74kXt8hmBDAoF1GRh?= =?us-ascii?Q?VBUdXyn0vpAQj22w9VuBGta2UY5CgHrCZb2UK4dqqfEdtUN6Hy/3EABc9N1u?= =?us-ascii?Q?q+/NODNA5QoOsXJlfn4pvHzkqB1iPakc+ebVCrb8+IvxcUwzvbECPbH2aNj0?= =?us-ascii?Q?cW X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: T9U/NEd+smrdTlCHpvix+TUfuNJUh5Gq5XZ1U1BRz70GwBvnzFW8vuYxrofa46XCazmg4PyT5JaII1n/DiiP9yYR1QMnWGl0dAz5Kg0A30oBmaen6FUanynHLYIyd/MsSzY5sEndXdXAaV/GKPA/qItpMMzE8Iwl11tU5YB+hPDbEcr0XQtDMOAq7lDWO/L0rkMBmd3YCbgMwmNebo3yFt5iqfFGf5v209kdctnqzFzotmg8WacLqyc+iFdvAF6uWyxpT86NpP8bOf6wZ1b0aoWANyB4TvaYMNtFf6thE6j7/bKnYmQsw65vSt8Z7Ml3V+zwWL9TLEg6yYKT2OLPZlfKwOs8qXSPA9PRk0/5glf+xkVbMscJirQRld84hX8aPhOSykG0USzsze7WN5Ju/6YZv2lladV+6Sf6Lmp/TzaGWu3fE4Eu+H8nyy0VKhgG31avKdHKUmEr9mgiP7DWzpatryqo2lV2WP1f5Iuvb9ywOzg40K280Jccd7sTtxNB6SacPQOzKqZlneA2iAMYJBzLJ/J7haRpQ5DeaY5roM3MVCPVy4cHkaxzN029GncGoGYcy4iKHmYnBwaKMQuTg6koZzEm2w6CriObh6TdeJw= 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: ab14ea92-a5d4-4e4c-47d8-08dbfb5a7289 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2023 21:36:48.9971 (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: oru0gK5oM+z6lsdVCqx+4Zb6x96spdFX5jyeFg/7O1ZlzImDFoCN7hvTkN7bRr65S77UKR2RERs1amqfxQWcnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR10MB7109 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-12_12,2023-12-12_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=650 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312120167 X-Proofpoint-ORIG-GUID: 8JJQVWlO5tlwR0wPelfbM0TkjhqmKwlp X-Proofpoint-GUID: 8JJQVWlO5tlwR0wPelfbM0TkjhqmKwlp Received-SPF: pass client-ip=205.220.165.32; envelope-from=drew.adams@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:313732 Archived-At: > in plain lisp with much clearer control-flow (not tested): >=20 > (defun byte-optimize-letX (form) > (if (consp form) > (let ((head (car form)) > (bindings (cadr form)) > (body (cddr form))) > (if bindings > (let ((const (car body)) > (rest (cdr body))) > (if (or (not body) > (and (macroexp-const-p const) > (not rest))) > ;; Body is empty or a constant. > (if (eq head 'let) > `(progn > ,@(mapcar #'cadr bindings) > ,const) > `(,head > ,(butlast bindings) > ,(cadar (last bindings)) ,const)) > (if (let ((last-var (car-safe (car (last bindings))))) > (and (symbolp last-var) > (equal body (list last-var)))) > ;; Body does nothing but return the last variable in > bindings. > (if (eq head 'let) > `(progn > ,@(mapcar #'cadr bindings)) > `(,head > ,(butlast bindings) > ,(cadar (last bindings)))) > form)) > ;; Bindings list is empty. > `(progn ,@body))) > form))) Maybe a little clearer than (if (consp xxx) (huge tree sexp) xxx) is (if (atom xxx) xxx (huge tree sexp)) I think more than a few folks forget about `atom', for some reason. (Sometimes I see (not (consp xxx)) or even (!) (null (consp xxx)).)