From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 12 04:41:14 2024 Received: (at submit) by debbugs.gnu.org; 12 Jun 2024 08:41:14 +0000 Received: from localhost ([127.0.0.1]:37505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sHJXd-0005z3-Q1 for submit@debbugs.gnu.org; Wed, 12 Jun 2024 04:41:14 -0400 Received: from lists.gnu.org ([209.51.188.17]:33808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sHJXb-0005yv-DM for submit@debbugs.gnu.org; Wed, 12 Jun 2024 04:41:12 -0400 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 1sHJXc-00045B-Bk for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2024 04:41:12 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sHJXZ-0003Bw-GK for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2024 04:41:12 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E51CA24002A for ; Wed, 12 Jun 2024 10:40:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1718181659; bh=6JVoAXghi92dpr9qpE2q1uFoi9n2IU2WxHlZi4CdHtU=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=dE7+qPimuJl/y6MhbaYCETO2OvflgI8WGpBW3jll+KI4fNS2XXezAfM8ghL9bmxOw 15olYMsEq86EUJKmpqf714Xo9fdQlQoMGdR06MqKkAiHUWZV+xVV/cECwAKYSYOlG8 JL7m/TpGLXXQ1umfsxK2YYOesJiRw+B3NWcSTGffHgWGkKMyPjIXF9EjOvZzvYHefM PmzruF5VH8w/aVsQWCxK00bl4D2c0GoNSAEjfaQTOf79gae5U41tmxbLtqQXtjtsKZ 9tGuY5MLbz8/39yPS5tJV9AVDdLoTEETqP5FKLWWPLwxCVhbFJW6Bd/X7MBxUs12ds vOfQjpHivJ3gA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VzfBz0Xgsz9rxD; Wed, 12 Jun 2024 10:40:59 +0200 (CEST) From: Mekeor Melire To: bug-gnu-emacs@gnu.org Subject: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected Date: Wed, 12 Jun 2024 08:40:54 +0000 Message-ID: <87r0d2lfjd.fsf@posteo.de> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=mekeor@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H3=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-Spam-Score: -1.3 (-) 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: -2.3 (--) I was expecting these two expressions to evaluate to the same value. First, we call `pcase' on a value with a pattern involving `and' and `guard': (pcase "value" ((and v (guard (string= "not-value" v))) v)) ;; => nil Second, let's use the same value and pattern, but this time using `pcase-lambda': (funcall (pcase-lambda ((and v (guard (string= "not-value" v)))) v) "value") ;; => "value" Am I missing something or is this a bug? In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.16.0). From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 14 04:42:37 2024 Received: (at 71503) by debbugs.gnu.org; 14 Jun 2024 08:42:37 +0000 Received: from localhost ([127.0.0.1]:39903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sI2W5-0003j8-8r for submit@debbugs.gnu.org; Fri, 14 Jun 2024 04:42:37 -0400 Received: from mout02.posteo.de ([185.67.36.66]:56037) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sI2W1-0003is-Bz for 71503@debbugs.gnu.org; Fri, 14 Jun 2024 04:42:35 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1E87A240104 for <71503@debbugs.gnu.org>; Fri, 14 Jun 2024 10:42:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1718354547; bh=0+fBUuPqMbugK6MqULc2J3dIzsoys3+Zi+7ltTaNuNA=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=q1AWFNmV7tGwsi+5Ls+hIeG08aAInFOt2W9afH0jPQR1r3Qz1tZTXHQOL5Qa77i29 EIVowGTWIHZ6IzVOh9LdskCQiMWblzSBMz5ps4ZX+c3Cq+shsIf5pEETb7CmhPnHyn /qpLJ1JtbDQEQeTlVqnolRFuneLZ1dhEejeve2BkGaYCmzwKD0PAkzvtSCqBC21Ecz Qrox8k7oP6JZngAbXDi2GMR4UkTNruHQo/gXoQ/su8W3hzSqTBJZjQq1UUuE8AlWBY Gh3aumrt65LQOVICnwXk/Z/eG/5nvIFrKjzom5m8ZFqfp8QAtF7iM5KKa13oMnh3n2 93W6qYFV8aDlg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W0t7k16bDz9rxL; Fri, 14 Jun 2024 10:42:26 +0200 (CEST) From: Philip Kaludercic To: Mekeor Melire Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected In-Reply-To: <87r0d2lfjd.fsf@posteo.de> (Mekeor Melire's message of "Wed, 12 Jun 2024 08:40:54 +0000") References: <87r0d2lfjd.fsf@posteo.de> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Fri, 14 Jun 2024 08:42:25 +0000 Message-ID: <87h6dvud8u.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503 Cc: 71503@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 (---) Mekeor Melire writes: > I was expecting these two expressions to evaluate to the same value. > First, we call `pcase' on a value with a pattern involving `and' and > `guard': > > (pcase "value" > ((and v (guard (string= "not-value" v))) v)) > ;; => nil > > Second, let's use the same value and pattern, but this time using > `pcase-lambda': > > (funcall > (pcase-lambda > ((and v (guard (string= "not-value" v)))) v) > "value") > ;; => "value" > > Am I missing something or is this a bug? The difference is that pcase-lambda doesn't do case-distinction, but just pattern matching/destruncting. So if the pattern-matching fails, then the variable is just not bound, instead of the entire expression falling back to returning no value/nil. I am guessing you wanted to have something like Scheme's `case-lambda'[0]? Or we could clarify this point in the docstring. > In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version > 3.24.41, cairo version 1.16.0). [0] https://index.scheme.org/filterset/r7rs_small/%28scheme%2520case-lambda%29/case-lambda -- Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 14 12:08:58 2024 Received: (at 71503) by debbugs.gnu.org; 14 Jun 2024 16:08:58 +0000 Received: from localhost ([127.0.0.1]:40805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sI9U1-0001YL-Rv for submit@debbugs.gnu.org; Fri, 14 Jun 2024 12:08:58 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:24616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sI9Tx-0001YA-9d for 71503@debbugs.gnu.org; Fri, 14 Jun 2024 12:08:56 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45EDH3ma022425; Fri, 14 Jun 2024 16:08:51 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=EYz84K1x+xDkyT2BseCVLh48/14kJ9GCajv1rrjhZOI=; b= hdoG4aGGXoc0CMyzKSkvv/V5ly80KgMGZquhcdTh5fONeVUqq/f9z0cVe9MLQKX/ /2SF9vj3FkiZK/4iwRee4QGBdpVUQ+UgjqyEnKd26iYwev/vcHdpPLmTm+ZjG+X6 LTffDUCzlsge2ekHR6l7mTDdTvh4ugLxDkxBbZWNyFlinVX2pPcc7x2YbCrakgTt maJS63W+RUfzgRY2cdXlWqU9/MWwJbPC1iLe9X/HsmbLOmlrAfEFIx9SSyWxgGcG caTavasuM0qOe5CvCWYYUeqIyrwfraxTo+QcG8vkWYVge7qLgMr2rNBPv2dk7jXt EiYwLxfr5nJmB0JGRafgKA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ymh7fuw68-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2024 16:08:50 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 45EF1Hw3020432; Fri, 14 Jun 2024 16:08:49 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3yncb04kpc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2024 16:08:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LARrTW00fkUD0DJoZZg3HJfe0sNlsuhmUak0Az28/3KKXTk3AOyIVl7MaAX6GVRonfBVS10Ni2RtqpjtWKi+hc2+q4Wy20PGYlbLGDEtNldlCEbg4VpVRpeQUgMUK1bDtfXqtRnFI65+6js7UBKkOWT1FQVKLUYq8dSEFtt2yacvX2m+0yiP3FvwgGZFfBHtVggf9SPJ1eyBavHyB87tZocQrRwr8pePsIQiyU8//A6EfNVYbc5puGi+odg5WJb5z3Q9hlfmkVLci/9IxwC/8zLPIaNATSJ0PhB2dJJ7AFSAWmSKu2R1/WrcwSqwiEAkDE2kkeYz1WiDFUUtXx6iUg== 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=EYz84K1x+xDkyT2BseCVLh48/14kJ9GCajv1rrjhZOI=; b=Z8kypgRXKoWVvCrkt11livg15MFdmfIuDAuuF2dgFd930y0YwGHzf/uxyNQYhfvKlML6XLo2C5A83t7/CcnEWra0UG9glxUkLpo/08RijKcxCkiAbgAIY1JADRs7TjC8gEmFoiwTKGaGB4l5DtTrypGx/t2fSw+qpnMTH3jxcvyVLjeBOEWb2EQDnoLyJJFoGEFAwxFAbqTXf8YzS9nki0DCCMliU7KCojaea7tXOdZpj0aRaQmPYhK4S6Rw0K3uoSk57lPeqEGWMiSIFfLDmejAzzUaVqmg9aXAvUNU+WPpYz68fQTnvtjHpjvi0AF7xHdwzzupzIM2b5SJdcoyeQ== 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=EYz84K1x+xDkyT2BseCVLh48/14kJ9GCajv1rrjhZOI=; b=qK1KOmKJ7I8TEV45zmtYXiTGydBosKGBvfeM0WHajq4CY/jBTSrqVq5kSi1xvCAmdDe+cbW9PryspWGAe015uWIedHiqmgc+cL9psGyVNAAfwYM9HEi9FcnCm+LK5iCGit+ANNfCITfNLcX3DuegcBVPei8bLChsppadko/01hM= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by IA0PR10MB6794.namprd10.prod.outlook.com (2603:10b6:208:43a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.40; Fri, 14 Jun 2024 16:08:45 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::b75a:ef76:884a:dd27]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::b75a:ef76:884a:dd27%4]) with mapi id 15.20.7677.024; Fri, 14 Jun 2024 16:08:41 +0000 From: Drew Adams To: Philip Kaludercic , Mekeor Melire Subject: RE: [External] : bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected Thread-Topic: [External] : bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected Thread-Index: AQHavjbxZLFZfJRkeEWDusLQZL6YcbHHbEvw Date: Fri, 14 Jun 2024 16:08:41 +0000 Message-ID: References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> In-Reply-To: <87h6dvud8u.fsf@posteo.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|IA0PR10MB6794:EE_ x-ms-office365-filtering-correlation-id: 110d6fc9-2239-47aa-1ff4-08dc8c8c4246 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230037|1800799021|366013|376011|38070700015; x-microsoft-antispam-message-info: =?us-ascii?Q?w+e4JLh1itny8SHsX0lWlhLvm07or8qp71h9R9SuAfzDa+GSVBFezDXjncfj?= =?us-ascii?Q?hX5daZYWCDWbSQrY/2VOQFSctrGMd0x7axvsR0opTtCW/SwHevY7AcL3NR+J?= =?us-ascii?Q?YdU/xTs1Sh/WDUuinHwzKgld/i55/MHYOiwlf2PKrD7WYNaGnVvLDppnqU3F?= =?us-ascii?Q?8KBrvOZ/V6S74+3n/5YwCpMvLSZhQ4OyM8pA/l5ZUVyFIOr5/CE2hAPwWNkr?= =?us-ascii?Q?nsJGKkzfC6Z/spIdQ4vByxK912NvMA81NZ9qGK4E58XfS71oMZmz5kJErMCp?= =?us-ascii?Q?cpC5/DL2166OEmVkOmt4MywqUkU9zjlRp0haTvNghc9ObZtKCRGK3x0/WRTj?= =?us-ascii?Q?bndjGRjzKHuzwTAcb40bAsdpmujcEY2gE2JgubV8A2SYg3gYXZq/kSUwEgna?= =?us-ascii?Q?VEcMPr8jtsRDdiGb8pa2S53g5ZW6rq+hFkW+FysYijcfNGtiB41yng0HRyKt?= =?us-ascii?Q?ACBkixw9ZbPwMmZziW6DtLoMu2CXAjSDENNqTJf7WDsLKLhwXLWLgzoKu4us?= =?us-ascii?Q?JEep3fYy90lG7P0Dmogxc2m3/0ncldxnjDJjzNHlI7ZSbtdiGYEomZYJWBK9?= =?us-ascii?Q?+OaY7cxtAs+YwXW24cXHrk0FJ4UXxUmyU7hJduYdklL/l1o6H2PvDq0fxk9Z?= =?us-ascii?Q?084JYB8O9H+H0zbKlCYdrXc8OJpj66tKpQ7dFjNXsolZ0yLzZKqEiyfK1osF?= =?us-ascii?Q?UIPFe01u1GA9sQoqx0WsrPfah2Vqq5yuc8e2J8bM+9wBSXEha1A6ewzMgBBV?= =?us-ascii?Q?bMuJte3nfq4q1o4JC39xVAY2VlLKeJc29kxyKcmfK7yo9wcvx8mpShSJJ7Qd?= =?us-ascii?Q?zE3KQDCG0w6jRyrp0+Rx9lAmvlI3DKH1OU4IORYaQXX1ZwXqZ6nbso8kbsgO?= =?us-ascii?Q?zvsaCMUQvug/B60aCtZHoWHnQfX9rXoyRCJLPNESFDqbsNnxpUKBN56YMmr9?= =?us-ascii?Q?wDZHBUJobzSYxBtlArXfHfFHuB0nYq1MDx1Efmdsxb5KAjjXx3sNzOPQ9zue?= =?us-ascii?Q?4Ygvkn7ox0P4R19HSv7fRnnhP99CKCbHEOQG+Zwur3iEyYmUwOmkaDxQrD+z?= =?us-ascii?Q?z0jc+pwkHEFgTOu+qz00RoLrOmNuCt5DTT8OYs3Ntr9Dc8IGQ5XhIO2pFYY8?= =?us-ascii?Q?U1qSpEJ/vZjPil615Tp0lUkYsB1HBTFbdAQFH79vKS0U1pFtoh2tLM0g/KcQ?= =?us-ascii?Q?nMy5eyJVsUe+bMLafRlC3ooORbTCsh/yWt/bH+VPelpXJQGnnl0sLDyYXMhl?= =?us-ascii?Q?kSH3RmltWHDtD+c301WvWOqhFZdhXeH0VqI7iDWwig/8PB7/Mqhohrkjdhxm?= =?us-ascii?Q?/kFED6scDZ+wvIwRMEQP4kgBLIk7I4j2frnLU16teiwrFCclYO1xv4l/7iWu?= =?us-ascii?Q?qOQQDDY=3D?= 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:(13230037)(1800799021)(366013)(376011)(38070700015); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nklXICG6IPo1cR6FqCbTGZMT2Ju39Kn6aeIG1QWD1+AvS2sJCPKLplk6vftY?= =?us-ascii?Q?kZKPfVo3tTseGAPOVprmuwkhzn1Eo23ZnePk2nTJvSgzXR6cvR0tgjXbGdhv?= =?us-ascii?Q?lpCDlP1tYQoyjfd+tTdW/OyhPUnY67px2Pl2xhwFuGq8j2d/hAAodBJZdyih?= =?us-ascii?Q?tDT22iS492Gj8rXbPIcIMCBueoCnxLhd3vLjTKHYdG9eGPPLtVkbw67B/O5a?= =?us-ascii?Q?rx7AUTvm5B5F4fhS4cb222eYMkAzC9OTBu8bNVgIV+ierckX/4B+ZCVv3G2C?= =?us-ascii?Q?VQkARmHqwAu+QPy6YvUx8eAb6+lmBWNOod5EOoQJsZ8fgFVmUuvpQR1cq15b?= =?us-ascii?Q?4pZvHJ7Lc1hn7kW932dtLGd5++mj4yUnMMj0Q5LaHQ6QwrWQxEW//CyJM8Pr?= =?us-ascii?Q?xY1tba3Px+/6Lb23Fu3NbUEvcCSvvz66PEnp7nBLkzMCdZFXhYacpwEvASfV?= =?us-ascii?Q?k4kG2HAGCYDiyqJ3chE7QhIEyJBa1flOWPrrRoHVrfaTWyxpRuTDpGQ4OM27?= =?us-ascii?Q?INdgADUaJLwg3KjbTBeBI1kelHNFDtWloSwlKjegG6ScthizbVmKkVmx0Xha?= =?us-ascii?Q?qXQqVMUlw1gAIcJjdneRCG3nRESmLNWX72Zw9zVo2hzWvZ1EzaYdJ2K6K2g5?= =?us-ascii?Q?n69LlX73PcdG9YCj50pmSQXb841v4+Yrab8HPsRMOoIRSHsQCOhtXKzTTEJ4?= =?us-ascii?Q?8hMmuvEa0wV4XdvpR15MgBa9cX5WXj4s7jYLbDzm/Gn5BO2wy6oPjrtXdEMs?= =?us-ascii?Q?1fN2mNOxHA6eXkqMtHgncUfrkn6gSESEYXvk11iRnfv3UEjlwrRHJD8fr8Vi?= =?us-ascii?Q?fTY/HuZXsb0ULrer929xXvQqoh/nt+0TweJUMm4o0+fHkhnxqICFiDIZY7al?= =?us-ascii?Q?msSiChvCOgjMtVi/q85iV4CcbXs4zXvsmN7mhvtQ14bjZDki+GZjwCO7wYa6?= =?us-ascii?Q?zxp4EHVMyky4sNcOx1devexO9aFjswt83LXlqIZRQzDgn7eXpG42bf66qfG/?= =?us-ascii?Q?b7MqyxbcnSInupfYVd4Byc23tMrxbAzWTnxDpa7VJuzkbYgHNSB5xdIOCWXH?= =?us-ascii?Q?3Ww9s/nfSG6V8w24ZXhiOa3jsbWTxMG4KX+wzBSUq/W1/dzDLJj6mjWsyVxC?= =?us-ascii?Q?GYduoe3jQu6Fqpi7iP1SNGMWKN2wG0kAXk0jS1zb1th9x9Y3yYgPU9l0uMWs?= =?us-ascii?Q?5KltEXkcF1CK0GB5edpZNxedSpqHO6pMSozbkMwV3JNRuKiFue9CKSAR/nZW?= =?us-ascii?Q?S0lnC90xxrKjIyJezZ9bD7gFpqSQ6/REGrX9vuHcKp7SO1SRpBpOTEf643S7?= =?us-ascii?Q?4eAgFNiEtWhwWLG1tz/OXqCVQMK6KrpafWmv/nyWtukQ2n6NJSssk4RX+8D8?= =?us-ascii?Q?+wXViMEcb6S7qIiBpeRjQT/LE415Rnoa8fk3ZrR4a1PKpcMgaYy1ryONe8mK?= =?us-ascii?Q?op2pXdrYdV95JKKDCpkLqqaNCeh3RyQGYEWvJnWalU2WEAitFqst+wZypIS5?= =?us-ascii?Q?GmWLM2QahiifEBG405x3iqdgy0Ip1ejlYrsUYfO1vE9Ze2zShWPC+rOoScup?= =?us-ascii?Q?Lg2SvSYizZBAqC9zwAzU2ZDsK26jOUUxg7dqS+TE?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 12MqkQg2crl0+XgC4DifUCyLW3mmOxCL3G4Ji5nEKLJSOGmGIJTM/kJrFqZKm+INo92u5c5w9Ylo8aSbgoJbDtFkC0P9Hefffse7l8pVyq9XKBp7XyjRwFhMM8owMeTxwBhDWEvGOLahIL95gPr5bCt4LbHoEFbTvvX3Z8KXL5nABkhVKiOURWTUCI9okGFd35qV/Sc5Ol7HJuhh6Dm0psSKYvwfSdtpQNhuh3qZ3oj86F1uY6EwM4Ws0KCtXXMhSw3W09hxyMOlvgfYm+8G/N4uG95nttcOnROtVV2rqwDAzJ7zB2lWuF+efdG4XzjjtYzNRgiTUf1P/g3VF4/WOTE2WQJQrx7P9Rg2ti7NiDvasZWq+hRzXbhjRMShYwvc5gkefBxIGr8wSLwVmnb0SQGx7w9mNrdRwxeiGw0Obx5sSat8hx7rKoUHEYsUrLPxjFo+0SPsRneZdLfWx8stltMp972fduIAp23JXU9EKzhoRLEQjKmlqOSHuNumPlSwomgJFPA9NUD/cXr/WMtMgKToZ42zqJbl5IedFAz5uTOUkVZsChLnEUPScVw74verLM4FaujTtaeEMMN1XQzNISYMkGUjhQDZ6UzhGlKBug4= 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: 110d6fc9-2239-47aa-1ff4-08dc8c8c4246 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jun 2024 16:08:41.4514 (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: HVsN1mstynZKO9I2T+tww6mGJR7p5L6jK/q8I8rbsNQM8bhfeDoZ6u3picr0NMrsWflvAITl1on2PrlKXOsZag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB6794 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-14_13,2024-06-14_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxscore=0 phishscore=0 mlxlogscore=673 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406140109 X-Proofpoint-GUID: amMeJmA2b-BP1xO6VhBEHMBOQuNpNCIP X-Proofpoint-ORIG-GUID: amMeJmA2b-BP1xO6VhBEHMBOQuNpNCIP X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71503 Cc: "71503@debbugs.gnu.org" <71503@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.0 (-) > The difference is that pcase-lambda > doesn't do case-distinction, but > just pattern matching/destruncting. Unless I'm mistaken, this confusion has surfaced several times now... Is it really a good idea to call this "pcase-" , if it has nothing to do with case distinction, i.e., control flow? Why not a name that suggests destructuring or pattern-matching, and binding? Common Lisp at least calls its (weaker) construct `destructuring-bind' - pretty clear. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 22 04:37:13 2024 Received: (at 71503) by debbugs.gnu.org; 22 Jun 2024 08:37:13 +0000 Received: from localhost ([127.0.0.1]:44317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKwFE-0008Oo-Mg for submit@debbugs.gnu.org; Sat, 22 Jun 2024 04:37:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKwFC-0008OY-Fi for 71503@debbugs.gnu.org; Sat, 22 Jun 2024 04:37:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKwF7-0006U7-4A; Sat, 22 Jun 2024 04:37:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=KXvm8DK2QTtDmbqBDRSqnmVoWaO09yTrb76gfUrBmKY=; b=QHFFnTnd0pN6 Ib5uh5bptJJAK8GxTh8BWP40EMnLe3Gc5g9hhLzewpwh2GjVnXX4WDbnye3d6bmgyMhLdNMMhb+Nl pZBqeS9N4eRj/uhtBsSzsAx9G2UwPwnRh9OxTrvwZiXcajDUPY2H/cL43SylFZNk4m2G5H3StBkpV Fmis0pyj85XgunreMDvGMFnN1/mYzkwMJVIFRvXnUZdIxn4+iGE5AOjCHMfCSf3XN95oRCQoOr+6H cxmOwLSTTmwFgJ6St7mhcBzqOZWqCIyDP7IA4APL2OWTaMVDibOOKA4KiP3NfoIRH5zgBOIw+aVo2 8X4WnliAomoyKZomEyfYdQ==; Date: Sat, 22 Jun 2024 11:37:02 +0300 Message-Id: <86tthlidap.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic , Stefan Monnier In-Reply-To: <87h6dvud8u.fsf@posteo.net> (message from Philip Kaludercic on Fri, 14 Jun 2024 08:42:25 +0000) Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503 Cc: mekeor@posteo.de, 71503@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 (---) > Cc: 71503@debbugs.gnu.org > From: Philip Kaludercic > Date: Fri, 14 Jun 2024 08:42:25 +0000 > > Mekeor Melire writes: > > > I was expecting these two expressions to evaluate to the same value. > > First, we call `pcase' on a value with a pattern involving `and' and > > `guard': > > > > (pcase "value" > > ((and v (guard (string= "not-value" v))) v)) > > ;; => nil > > > > Second, let's use the same value and pattern, but this time using > > `pcase-lambda': > > > > (funcall > > (pcase-lambda > > ((and v (guard (string= "not-value" v)))) v) > > "value") > > ;; => "value" > > > > Am I missing something or is this a bug? > > The difference is that pcase-lambda doesn't do case-distinction, but > just pattern matching/destruncting. So if the pattern-matching fails, > then the variable is just not bound, instead of the entire expression > falling back to returning no value/nil. I am guessing you wanted to > have something like Scheme's `case-lambda'[0]? Or we could clarify this > point in the docstring. Would you mind suggesting a clarification for the doc string (and the ELisp manual as well)? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 06 03:38:13 2024 Received: (at 71503) by debbugs.gnu.org; 6 Jul 2024 07:38:13 +0000 Received: from localhost ([127.0.0.1]:45491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPzzp-0005IF-EO for submit@debbugs.gnu.org; Sat, 06 Jul 2024 03:38:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPzzn-0005Hx-9J for 71503@debbugs.gnu.org; Sat, 06 Jul 2024 03:38:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPzze-00038F-2C; Sat, 06 Jul 2024 03:38:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=AkFgevUKqLqlTOiWh5zqfE4tMaK+YvkaP3Ot4xwhuqI=; b=Nl7xZz8ivsuW EzmsWFD6NhUPLfRrp+qZmoWFsXz4eIOGGUCsibSj8gNOlKmJEIzXqRiWWPBod5L1XQ+M/bdsGW21l y4qJvI34G7YXODILLv+jLOTRMdY9UDJ6jjVXFd+ljhu//Y1f2+RnzDLJkXQuPEmMg2zeodfNX1nQ7 qpK3/5dP6d21r3TqAnIl7m9UDDTBQ1gzXr4IlwRF4530UHyF8hh2mh3PmAqmU+EX68KdxfXgBy5FV iZMKqTb63/6PMTeeg3G5UxJQAwdt4vQ4bMcNLRgupw5msRAFqqArsJGJDZRDIvNGegbiJ9WncITQC fu6huPQKv+GLmgapMLv1ZA==; Date: Sat, 06 Jul 2024 10:38:00 +0300 Message-Id: <86frsn55t3.fsf@gnu.org> From: Eli Zaretskii To: philipk@posteo.net In-Reply-To: <86tthlidap.fsf@gnu.org> (message from Eli Zaretskii on Sat, 22 Jun 2024 11:37:02 +0300) Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503 Cc: mekeor@posteo.de, monnier@iro.umontreal.ca, 71503@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 (---) Ping! > Cc: mekeor@posteo.de, 71503@debbugs.gnu.org > Date: Sat, 22 Jun 2024 11:37:02 +0300 > From: Eli Zaretskii > > > Cc: 71503@debbugs.gnu.org > > From: Philip Kaludercic > > Date: Fri, 14 Jun 2024 08:42:25 +0000 > > > > Mekeor Melire writes: > > > > > I was expecting these two expressions to evaluate to the same value. > > > First, we call `pcase' on a value with a pattern involving `and' and > > > `guard': > > > > > > (pcase "value" > > > ((and v (guard (string= "not-value" v))) v)) > > > ;; => nil > > > > > > Second, let's use the same value and pattern, but this time using > > > `pcase-lambda': > > > > > > (funcall > > > (pcase-lambda > > > ((and v (guard (string= "not-value" v)))) v) > > > "value") > > > ;; => "value" > > > > > > Am I missing something or is this a bug? > > > > The difference is that pcase-lambda doesn't do case-distinction, but > > just pattern matching/destruncting. So if the pattern-matching fails, > > then the variable is just not bound, instead of the entire expression > > falling back to returning no value/nil. I am guessing you wanted to > > have something like Scheme's `case-lambda'[0]? Or we could clarify this > > point in the docstring. > > Would you mind suggesting a clarification for the doc string (and the > ELisp manual as well)? > > Thanks. > > > > From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 20 05:42:54 2024 Received: (at 71503) by debbugs.gnu.org; 20 Jul 2024 09:42:54 +0000 Received: from localhost ([127.0.0.1]:51741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sV6c9-0007yW-Sw for submit@debbugs.gnu.org; Sat, 20 Jul 2024 05:42:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sV6c8-0007yG-KQ for 71503@debbugs.gnu.org; Sat, 20 Jul 2024 05:42:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sV6c3-0001dh-2z; Sat, 20 Jul 2024 05:42:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=cDvBZkhCb4VcESEX/o3gldnyzkMKanq9cb8z8a5UDNM=; b=GutmEhGQSybH naaapPJK9iIumZmAYq3P6Yqx+Ftq9rN8OI1mvCgVOlTcxCoTHKwCY6ZxkaR5rVS0u5Uocg+LKBvM6 Q//8f+IKgqsoHW1bnb90CJAwe94jKSx9q+tJqYQ+ZoFuqfNnamM5Xn6E0h7gC5os2Hk86qj3QtWOd /a4MJTZ1YVRjz3B3HGzg0uPJNsau3ab5fRDeBe7Nx086XOMMDJeuwC5eNPFDf8y355dMZITPqxdE0 +uiMN8wuws2c+/JNCzWgNg1FPGNis3WqrMIg07dVt/eRKTQGR8E+Pz1kCxardw3mbU/CZnQL6ITpw r2W6YXNVoSV63+58guy7hg==; Date: Sat, 20 Jul 2024 12:42:43 +0300 Message-Id: <865xt0e6wc.fsf@gnu.org> From: Eli Zaretskii To: philipk@posteo.net, mekeor@posteo.de In-Reply-To: <86frsn55t3.fsf@gnu.org> (message from Eli Zaretskii on Sat, 06 Jul 2024 10:38:00 +0300) Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> <86frsn55t3.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503 Cc: monnier@iro.umontreal.ca, 71503@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 (---) Ping! Ping! > Cc: mekeor@posteo.de, monnier@iro.umontreal.ca, 71503@debbugs.gnu.org > Date: Sat, 06 Jul 2024 10:38:00 +0300 > From: Eli Zaretskii > > Ping! > > > Cc: mekeor@posteo.de, 71503@debbugs.gnu.org > > Date: Sat, 22 Jun 2024 11:37:02 +0300 > > From: Eli Zaretskii > > > > > Cc: 71503@debbugs.gnu.org > > > From: Philip Kaludercic > > > Date: Fri, 14 Jun 2024 08:42:25 +0000 > > > > > > Mekeor Melire writes: > > > > > > > I was expecting these two expressions to evaluate to the same value. > > > > First, we call `pcase' on a value with a pattern involving `and' and > > > > `guard': > > > > > > > > (pcase "value" > > > > ((and v (guard (string= "not-value" v))) v)) > > > > ;; => nil > > > > > > > > Second, let's use the same value and pattern, but this time using > > > > `pcase-lambda': > > > > > > > > (funcall > > > > (pcase-lambda > > > > ((and v (guard (string= "not-value" v)))) v) > > > > "value") > > > > ;; => "value" > > > > > > > > Am I missing something or is this a bug? > > > > > > The difference is that pcase-lambda doesn't do case-distinction, but > > > just pattern matching/destruncting. So if the pattern-matching fails, > > > then the variable is just not bound, instead of the entire expression > > > falling back to returning no value/nil. I am guessing you wanted to > > > have something like Scheme's `case-lambda'[0]? Or we could clarify this > > > point in the docstring. > > > > Would you mind suggesting a clarification for the doc string (and the > > ELisp manual as well)? > > > > Thanks. > > > > > > > > > > > > From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 20 06:30:09 2024 Received: (at 71503) by debbugs.gnu.org; 20 Jul 2024 10:30:09 +0000 Received: from localhost ([127.0.0.1]:51868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sV7Ls-0003qz-Kg for submit@debbugs.gnu.org; Sat, 20 Jul 2024 06:30:09 -0400 Received: from mout01.posteo.de ([185.67.36.65]:36751) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sV7Lq-0003pv-00 for 71503@debbugs.gnu.org; Sat, 20 Jul 2024 06:30:07 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 64177240028 for <71503@debbugs.gnu.org>; Sat, 20 Jul 2024 12:29:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1721471398; bh=bXOf150drr+G6o87o04NWuMeD7enAc9XE4FO6ByaCCM=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=I0KANMapo+d5LiItKPPKdV0Fl1N4pCbUkgGPCpea1/qcvpoQbh/9TIKcH/SVkmPIC bhl5EGST3iiP86vPlGWCc4whokBRlZBk2UeEIbOnGUDteo+SsFqyoYSi+yuGTobVZM 4XxtLWMPhezYsvHcZnMULf4pXWqnuSTqN/sk8nZInhzlZg0eUIdcofgbyEGmwVAEBC P61iC9C0yNnwQW6vP9I6e6Byeb/3wo0CvhZ/RKJgi5dCuOLWQOFAA+B4IIb1HBqI6M v7lKQzirNjsCu82tvAb7ChMSBFvxKQQxzQGGkUYnUPmNl0eG4qbFg+HDiHyjoxGhdY BD9jKRJAJBeLw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WR2q909CWz6trs; Sat, 20 Jul 2024 12:29:55 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected In-Reply-To: <865xt0e6wc.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 20 Jul 2024 12:42:43 +0300") References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> <86frsn55t3.fsf@gnu.org> <865xt0e6wc.fsf@gnu.org> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Sat, 20 Jul 2024 10:29:55 +0000 Message-ID: <87ikx0mk4c.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503 Cc: mekeor@posteo.de, monnier@iro.umontreal.ca, 71503@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 (---) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Ping! Ping! > >> Cc: mekeor@posteo.de, monnier@iro.umontreal.ca, 71503@debbugs.gnu.org >> Date: Sat, 06 Jul 2024 10:38:00 +0300 >> From: Eli Zaretskii >> >> Ping! >> >> > Cc: mekeor@posteo.de, 71503@debbugs.gnu.org >> > Date: Sat, 22 Jun 2024 11:37:02 +0300 >> > From: Eli Zaretskii >> > >> > > Cc: 71503@debbugs.gnu.org >> > > From: Philip Kaludercic >> > > Date: Fri, 14 Jun 2024 08:42:25 +0000 >> > > >> > > Mekeor Melire writes: >> > > >> > > > I was expecting these two expressions to evaluate to the same value. >> > > > First, we call `pcase' on a value with a pattern involving `and' and >> > > > `guard': >> > > > >> > > > (pcase "value" >> > > > ((and v (guard (string= "not-value" v))) v)) >> > > > ;; => nil >> > > > >> > > > Second, let's use the same value and pattern, but this time using >> > > > `pcase-lambda': >> > > > >> > > > (funcall >> > > > (pcase-lambda >> > > > ((and v (guard (string= "not-value" v)))) v) >> > > > "value") >> > > > ;; => "value" >> > > > >> > > > Am I missing something or is this a bug? >> > > >> > > The difference is that pcase-lambda doesn't do case-distinction, but >> > > just pattern matching/destruncting. So if the pattern-matching fails, >> > > then the variable is just not bound, instead of the entire expression >> > > falling back to returning no value/nil. I am guessing you wanted to >> > > have something like Scheme's `case-lambda'[0]? Or we could clarify this >> > > point in the docstring. >> > >> > Would you mind suggesting a clarification for the doc string (and the >> > ELisp manual as well)? Sorry, I didn't realise you were pining me. I was thinking of something like --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 5a7f3995311..f546ba34c7c 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -241,9 +241,10 @@ pcase-exhaustive ;;;###autoload (defmacro pcase-lambda (lambda-list &rest body) "Like `lambda' but allow each argument to be a pattern. -I.e. accepts the usual &optional and &rest keywords, but every -formal argument can be any pattern accepted by `pcase' (a mere -variable name being but a special case of it)." +I.e. accepts the usual &optional and &rest keywords, but every formal +argument can be any pattern accepted by `pcase' (a mere variable name +being but a special case of it). Keep in mind that BODY is always +evaluated, regardless of whether the argument-patterns match or not." (declare (doc-string 2) (indent defun) (debug (&define (&rest pcase-PAT) lambda-doc def-body))) (let* ((bindings ()) --=-=-= Content-Type: text/plain but now I notice that `pcase-let*' documents that all expressions should match, Each EXP should match its respective PATTERN (i.e. be of structure compatible to PATTERN); a mismatch may signal an error or may go undetected, binding variables to arbitrary values, such as nil. Since `pcase-lambda' inherits these semantics we would have to propagate this promise -- or be more specific about what happens, e.g. binding values to nil. >> > Thanks. -- Philip Kaludercic on peregrine --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 20 06:46:56 2024 Received: (at 71503) by debbugs.gnu.org; 20 Jul 2024 10:46:56 +0000 Received: from localhost ([127.0.0.1]:51878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sV7c8-0004G1-77 for submit@debbugs.gnu.org; Sat, 20 Jul 2024 06:46:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sV7c6-0004Fo-Je for 71503@debbugs.gnu.org; Sat, 20 Jul 2024 06:46:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sV7c0-0005P0-JW; Sat, 20 Jul 2024 06:46:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=pc8zMUWAkcxM5zOhFo5bavnNPiP1DfwXKldLIJm/j4U=; b=VQm35qZcSNX8 uYtOJB5OrGVOUJyKaTJtOqD6BvJ0ObSn+zTTjxTdvknqnreHXBdTLjYFKmPuzjYZXMTQOM7z0ilNo GZ+W56OWOFBHKDzN99E4Ap304J1QnyOp7NzJvx4FrSHNoRdw5eg2EtTIUSo3ETRrQ1HT8nM0ewU0j tgcL7/HxyT1h/YmvplyLIk+l/xQYmfzOdnYxKR99BpYq7BIkgcX4+6JAIs4b4mltbeWsnGCRq88oB GQU4/OJydSo3h2IMAMx13h4HHpaIFycCBKpfuUICw7JGtIFrsUNzufyTXBH9samDemAzeJC2lws4e gU3cHtD1MsvEqeNb5iBCUA==; Date: Sat, 20 Jul 2024 13:46:45 +0300 Message-Id: <86r0bocpd6.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87ikx0mk4c.fsf@posteo.net> (message from Philip Kaludercic on Sat, 20 Jul 2024 10:29:55 +0000) Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> <86frsn55t3.fsf@gnu.org> <865xt0e6wc.fsf@gnu.org> <87ikx0mk4c.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503 Cc: mekeor@posteo.de, monnier@iro.umontreal.ca, 71503@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 (---) > From: Philip Kaludercic > Cc: mekeor@posteo.de, monnier@iro.umontreal.ca, 71503@debbugs.gnu.org > Date: Sat, 20 Jul 2024 10:29:55 +0000 > > >> > > The difference is that pcase-lambda doesn't do case-distinction, but > >> > > just pattern matching/destruncting. So if the pattern-matching fails, > >> > > then the variable is just not bound, instead of the entire expression > >> > > falling back to returning no value/nil. I am guessing you wanted to > >> > > have something like Scheme's `case-lambda'[0]? Or we could clarify this > >> > > point in the docstring. > >> > > >> > Would you mind suggesting a clarification for the doc string (and the > >> > ELisp manual as well)? > > Sorry, I didn't realise you were pining me. I was thinking of something > like > > diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el > index 5a7f3995311..f546ba34c7c 100644 > --- a/lisp/emacs-lisp/pcase.el > +++ b/lisp/emacs-lisp/pcase.el > @@ -241,9 +241,10 @@ pcase-exhaustive > ;;;###autoload > (defmacro pcase-lambda (lambda-list &rest body) > "Like `lambda' but allow each argument to be a pattern. > -I.e. accepts the usual &optional and &rest keywords, but every > -formal argument can be any pattern accepted by `pcase' (a mere > -variable name being but a special case of it)." > +I.e. accepts the usual &optional and &rest keywords, but every formal > +argument can be any pattern accepted by `pcase' (a mere variable name > +being but a special case of it). Keep in mind that BODY is always > +evaluated, regardless of whether the argument-patterns match or not." > (declare (doc-string 2) (indent defun) > (debug (&define (&rest pcase-PAT) lambda-doc def-body))) > (let* ((bindings ()) > > but now I notice that `pcase-let*' documents that all expressions should > match, > > Each EXP should match its respective PATTERN (i.e. be of structure > compatible to PATTERN); a mismatch may signal an error or may go > undetected, binding variables to arbitrary values, such as nil. > > Since `pcase-lambda' inherits these semantics we would have to propagate > this promise -- or be more specific about what happens, e.g. binding > values to nil. Thanks. If this still can be fixed by some documentation changes, I'd prefer to do that. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 20 10:06:50 2024 Received: (at 71503) by debbugs.gnu.org; 20 Jul 2024 14:06:51 +0000 Received: from localhost ([127.0.0.1]:53713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVAja-0004b9-Gy for submit@debbugs.gnu.org; Sat, 20 Jul 2024 10:06:50 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVAjZ-0004aq-5f for 71503@debbugs.gnu.org; Sat, 20 Jul 2024 10:06:49 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AD1794400B7; Sat, 20 Jul 2024 10:06:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1721484400; bh=W9gr0pIePc3axyk6u/4iLz6/zg0A7o8/Cd3dewW1m+A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Ayu1yrx0gE0uBzbPfpuwpfb17wtoaguvJ/iekqMT9XAFZFxqxCqy+2P28AkUp9kA2 KTbLwH1RRHJsISHjHjjeadT0eDWt4627HJXrebtni9NyPtqOgfHRnrXjl5/if5hlh+ Q9iyK1tbr4oj8qz7ccG8svuITRIL9ZvtLG8yeLbBzZZpD9Nxl9ywSjM3g3L+tu/cgq gUTckyM5ERDtpE5ZhWvX8OmUvN1s+1QByVcF+VBEdu/mVSKgZPIKV2twfBB01w8b7V Wet7IetrxlS/pN/rT7f0udyZDXlwj/RRTaZcLG1R8H/CKbcrCg09p/o1RRn3lF7ElK XKWQTAZyEzu5Q== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 28725440B54; Sat, 20 Jul 2024 10:06:40 -0400 (EDT) Received: from pastel (unknown [45.72.245.253]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E8B1212014D; Sat, 20 Jul 2024 10:06:39 -0400 (EDT) From: Stefan Monnier To: Philip Kaludercic Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected In-Reply-To: <87ikx0mk4c.fsf@posteo.net> (Philip Kaludercic's message of "Sat, 20 Jul 2024 10:29:55 +0000") Message-ID: References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> <86frsn55t3.fsf@gnu.org> <865xt0e6wc.fsf@gnu.org> <87ikx0mk4c.fsf@posteo.net> Date: Sat, 20 Jul 2024 10:06:18 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) 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.251 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 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503 Cc: mekeor@posteo.de, Eli Zaretskii , 71503@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 (---) > (defmacro pcase-lambda (lambda-list &rest body) > "Like `lambda' but allow each argument to be a pattern. > -I.e. accepts the usual &optional and &rest keywords, but every > -formal argument can be any pattern accepted by `pcase' (a mere > -variable name being but a special case of it)." > +I.e. accepts the usual &optional and &rest keywords, but every formal > +argument can be any pattern accepted by `pcase' (a mere variable name > +being but a special case of it). Keep in mind that BODY is always > +evaluated, regardless of whether the argument-patterns match or not." > (declare (doc-string 2) (indent defun) > (debug (&define (&rest pcase-PAT) lambda-doc def-body))) > (let* ((bindings ()) I tend to call "any pattern accepted by `pcase'" a "Pcase pattern". More importantly, we should refer to `pcase-let` rather than to `pcase` here and we should likely use the term "destructuring (binding)". Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 07:17:18 2024 Received: (at 71503) by debbugs.gnu.org; 21 Jul 2024 11:17:18 +0000 Received: from localhost ([127.0.0.1]:54805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVUZ3-0007Rd-Qa for submit@debbugs.gnu.org; Sun, 21 Jul 2024 07:17:18 -0400 Received: from mout01.posteo.de ([185.67.36.65]:40137) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVUZ1-0007RP-9H for 71503@debbugs.gnu.org; Sun, 21 Jul 2024 07:17:16 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 21552240029 for <71503@debbugs.gnu.org>; Sun, 21 Jul 2024 13:17:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1721560627; bh=d1mXl20sg7Tvz1u7CW9gmumWDFBhXt7tXcfdHA+24SQ=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=Mb+0aoh8/njkKJr6dPnqrBCJSJDWHQzX2zGL0NqkxLnanxLiWyZF1kZI0SnIo5rea +ZII80lP5F6DyN4k975eTYG4tCLx3hIA+0v78D3Kt4NHfx/dTwA1dofGiPlf+fTccD n60J5puDi2N00W4bo8QeZxSYE7mHs+J5vbmrQ0XXqy+Q+5R50I06fgjVdRr/wFCQ1a U7OXhWmccifL7eKc52Qwf/Gx2R0tTP+u+8YWuaMNLHdCvzhGh+p4iurleF1NwtgVuD Ok1hvwDTIy7x68RnCnC/xWg07EPhLXavufUmvEQmsvYExewM/zYxhbzP1tYxHgiTxe vUV6L31/+jQDA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WRgq61fvZz6tlh; Sun, 21 Jul 2024 13:17:06 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected In-Reply-To: <86r0bocpd6.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 20 Jul 2024 13:46:45 +0300") References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> <86frsn55t3.fsf@gnu.org> <865xt0e6wc.fsf@gnu.org> <87ikx0mk4c.fsf@posteo.net> <86r0bocpd6.fsf@gnu.org> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Sun, 21 Jul 2024 11:17:05 +0000 Message-ID: <87zfqbkn9q.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503 Cc: mekeor@posteo.de, monnier@iro.umontreal.ca, 71503@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 (---) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: mekeor@posteo.de, monnier@iro.umontreal.ca, 71503@debbugs.gnu.org >> Date: Sat, 20 Jul 2024 10:29:55 +0000 >> >> >> > > The difference is that pcase-lambda doesn't do case-distinction, but >> >> > > just pattern matching/destruncting. So if the pattern-matching fails, >> >> > > then the variable is just not bound, instead of the entire expression >> >> > > falling back to returning no value/nil. I am guessing you wanted to >> >> > > have something like Scheme's `case-lambda'[0]? Or we could >> >> > > clarify this >> >> > > point in the docstring. >> >> > >> >> > Would you mind suggesting a clarification for the doc string (and the >> >> > ELisp manual as well)? >> >> Sorry, I didn't realise you were pining me. I was thinking of something >> like >> >> diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el >> index 5a7f3995311..f546ba34c7c 100644 >> --- a/lisp/emacs-lisp/pcase.el >> +++ b/lisp/emacs-lisp/pcase.el >> @@ -241,9 +241,10 @@ pcase-exhaustive >> ;;;###autoload >> (defmacro pcase-lambda (lambda-list &rest body) >> "Like `lambda' but allow each argument to be a pattern. >> -I.e. accepts the usual &optional and &rest keywords, but every >> -formal argument can be any pattern accepted by `pcase' (a mere >> -variable name being but a special case of it)." >> +I.e. accepts the usual &optional and &rest keywords, but every formal >> +argument can be any pattern accepted by `pcase' (a mere variable name >> +being but a special case of it). Keep in mind that BODY is always >> +evaluated, regardless of whether the argument-patterns match or not." >> (declare (doc-string 2) (indent defun) >> (debug (&define (&rest pcase-PAT) lambda-doc def-body))) >> (let* ((bindings ()) >> >> but now I notice that `pcase-let*' documents that all expressions should >> match, >> >> Each EXP should match its respective PATTERN (i.e. be of structure >> compatible to PATTERN); a mismatch may signal an error or may go >> undetected, binding variables to arbitrary values, such as nil. >> >> Since `pcase-lambda' inherits these semantics we would have to propagate >> this promise -- or be more specific about what happens, e.g. binding >> values to nil. > > Thanks. If this still can be fixed by some documentation changes, I'd > prefer to do that. In that case I think it would be better to stick to a warning like the one in `pcase-let*'.. Stefan Monnier writes: [...] > I tend to call "any pattern accepted by `pcase'" a "Pcase pattern". > More importantly, we should refer to `pcase-let` rather than to > `pcase` here and we should likely use the term "destructuring (binding)". What do you think of: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 5a7f3995311..fd6b0c8db5c 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -241,9 +241,14 @@ pcase-exhaustive ;;;###autoload (defmacro pcase-lambda (lambda-list &rest body) "Like `lambda' but allow each argument to be a pattern. -I.e. accepts the usual &optional and &rest keywords, but every -formal argument can be any pattern accepted by `pcase' (a mere -variable name being but a special case of it)." +I.e. accepts the usual &optional and &rest keywords, but every formal +argument can be any pattern destructed by `pcase-let' (a mere variable +name being but a special case of it). + +Each argument should match its respective pattern in the parameter +list (i.e. be of a compatible structure); a mismatch may signal an error +or may go undetected, binding arguments to arbitrary values, such as +nil." (declare (doc-string 2) (indent defun) (debug (&define (&rest pcase-PAT) lambda-doc def-body))) (let* ((bindings ()) --=-=-= Content-Type: text/plain > Stefan > -- Philip Kaludercic on peregrine --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 08:39:13 2024 Received: (at 71503) by debbugs.gnu.org; 21 Jul 2024 12:39:13 +0000 Received: from localhost ([127.0.0.1]:54869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVVqL-0003vn-AW for submit@debbugs.gnu.org; Sun, 21 Jul 2024 08:39:13 -0400 Received: from mout01.posteo.de ([185.67.36.65]:54543) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVVqI-0003vX-OZ for 71503@debbugs.gnu.org; Sun, 21 Jul 2024 08:39:11 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 12F6E240027 for <71503@debbugs.gnu.org>; Sun, 21 Jul 2024 14:39:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1721565543; bh=9Bpe/XfpJwB2yQyYSPTe7fSMsHsJ/75whL2Yh33w32s=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=DgEbsGWOydfbp4J7LL7QsggjbHRnD4Lyr7ph+GdypasDUnFTvnAvPo80Go9FsPzMK v9+j9q3VfBGgMxd0MlegM9cQE05ltXGJyiA/sLpYnc9ljM6KpZfHKadt5Lg+BsD11s G9i/zLr5s7r/xYT1P9v6IkCF3xQSDsY3LXr1AtfiDPmFcvtzm8GGq4dEI397s71o8b 4Nwhzh7Ug5PYjtEmKLZ/8ZyUZ1ytKZNwVAteNc/gyf3U2gmaEmuIOHNn66qD+2huCx Ykwirujd3jPHVdIkLGYupezBM91stVBlBJ87s3DhPRKobL/2OH4L0l6dxLL52LnA7D XumK+McTqVDRg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WRjdd5fxZz6tsB; Sun, 21 Jul 2024 14:39:01 +0200 (CEST) From: Philip Kaludercic To: Stefan Monnier Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected In-Reply-To: (Stefan Monnier's message of "Sat, 20 Jul 2024 10:06:18 -0400") References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> <86frsn55t3.fsf@gnu.org> <865xt0e6wc.fsf@gnu.org> <87ikx0mk4c.fsf@posteo.net> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Sun, 21 Jul 2024 12:39:00 +0000 Message-ID: <87sew2ly1n.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503 Cc: mekeor@posteo.de, Eli Zaretskii , 71503@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 (---) Stefan Monnier writes: >> (defmacro pcase-lambda (lambda-list &rest body) >> "Like `lambda' but allow each argument to be a pattern. >> -I.e. accepts the usual &optional and &rest keywords, but every >> -formal argument can be any pattern accepted by `pcase' (a mere >> -variable name being but a special case of it)." >> +I.e. accepts the usual &optional and &rest keywords, but every formal >> +argument can be any pattern accepted by `pcase' (a mere variable name >> +being but a special case of it). Keep in mind that BODY is always >> +evaluated, regardless of whether the argument-patterns match or not." >> (declare (doc-string 2) (indent defun) >> (debug (&define (&rest pcase-PAT) lambda-doc def-body))) >> (let* ((bindings ()) > > I tend to call "any pattern accepted by `pcase'" a "Pcase pattern". > More importantly, we should refer to `pcase-let` rather than to > `pcase` here and we should likely use the term "destructuring (binding)". Another confusing behaviour that we should document is that in (let ((a nil)) (funcall (pcase-lambda (a (and (guard a) b)) (list a b)) 1 2)) I would expect that the (guard a) would use the nil binding from the `let' form, but instead it is ignored and b is bound to 2. I am not sure if this is related to the "destructing" point or not. > > > Stefan > -- Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 09:33:35 2024 Received: (at 71503) by debbugs.gnu.org; 21 Jul 2024 13:33:36 +0000 Received: from localhost ([127.0.0.1]:54903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVWgx-0005Ro-Bu for submit@debbugs.gnu.org; Sun, 21 Jul 2024 09:33:35 -0400 Received: from mout01.posteo.de ([185.67.36.65]:44597) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVWgu-0005Ra-AE for 71503@debbugs.gnu.org; Sun, 21 Jul 2024 09:33:33 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 89527240029 for <71503@debbugs.gnu.org>; Sun, 21 Jul 2024 15:33:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1721568803; bh=fEAcSGKyK63MK5tpKMGLBn6FBkz/rMI9bByoPHUTWug=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=kwro8M8tVci+97v6fr7wc+6ISj3NRsuAurr+GleQbnEBCbqpuPjRWtBZySsNQWzXD Om+nAZud6TG+jGYDAkF831QaV+kOwWwLB8T2RPfrx1HKvf3OGDXi5bG9JaJvCetg7d 0KQHtSiYnoxljafkQxCAIL67MOnPj3DhA/gyBedMZH6TGxTNhJ755pDlw4zHh8SVtV YEnfNY3Q1G+JQjzY5hCUJ/FDZmMUPMRwP4vo8guKKzxCY+lFrLoRWHkDvYMwtL6VG5 1PGqUccCHIx5ovEK+82YIo1rIEk+tdRwbMEDA1vtXuaLHKEUGouDUBY7lJKouCEhD/ WCGFbIcNOk9Dg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WRkrL2ms7z9rxB; Sun, 21 Jul 2024 15:33:22 +0200 (CEST) From: Mekeor Melire To: 71503@debbugs.gnu.org Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected In-Reply-To: <87zfqbkn9q.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 21 Jul 2024 11:17:05 +0000") References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> <86frsn55t3.fsf@gnu.org> <865xt0e6wc.fsf@gnu.org> <87ikx0mk4c.fsf@posteo.net> <86r0bocpd6.fsf@gnu.org> <87zfqbkn9q.fsf@posteo.net> Date: Sun, 21 Jul 2024 13:33:18 +0000 Message-ID: <87o76qswdd.fsf@posteo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503 Cc: Philip Kaludercic , Eli Zaretskii , monnier@iro.umontreal.ca 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 (---) 2024-07-21 11:17 philipk@posteo.net: > What do you think of: > "Like `lambda' but allow each argument to be a pattern. > -I.e. accepts the usual &optional and &rest keywords, but every > -formal argument can be any pattern accepted by `pcase' (a mere > -variable name being but a special case of it)." > +I.e. accepts the usual &optional and &rest keywords, but every formal > +argument can be any pattern destructed by `pcase-let' (a mere variable > +name being but a special case of it). > + > +Each argument should match its respective pattern in the parameter > +list (i.e. be of a compatible structure); a mismatch may signal an error > +or may go undetected, binding arguments to arbitrary values, such as > +nil." > (declare (doc-string 2) (indent defun) > (debug (&define (&rest pcase-PAT) lambda-doc def-body))) > (let* ((bindings ()) Being the submitter of this bug-report, this suggested change would indeed fix the problem for me and would avoid confusion. I thus support this change and thank y'all for your efforts. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 09:51:16 2024 Received: (at 71503) by debbugs.gnu.org; 21 Jul 2024 13:51:16 +0000 Received: from localhost ([127.0.0.1]:54920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVWy4-0005rN-9w for submit@debbugs.gnu.org; Sun, 21 Jul 2024 09:51:16 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64235) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVWy3-0005rC-HU for 71503@debbugs.gnu.org; Sun, 21 Jul 2024 09:51:15 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1515A80836; Sun, 21 Jul 2024 09:51:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1721569865; bh=7iCngnAgL6VTUTCuIR6RLG8y8fIyOiSkMRy4Axd6CiQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LN8Wu8NqUpRGqCjCbEpUqGO7maRG4bitK7/2GTYDGm1pHabuawoq1jkgR23crvved ANyIXXWWdEREc/U7f0wjKMu+6keUVS074Vw1OzFqoNdwQp8LDh9Jh5K6vYu0aFvpno H/jw70pT1on4hSyfHFq6lkyGIrWKmBJVEhT6d5K/pieKLtTyRHc5m17+Bn48Y8jkVP 1eUjcMuLIMQBH8JfgDLbqDjiYCzXzwlf4ios7tqRxwXmWZySJXs+eJxgfNnJx99k/e h5aRB3vsPxmLNaXMeQvrAcsoRtsjMCSX1DwbpOaEdayx0oG1aMyXd8KrUppdSDDWKp Ob/VUOEkkvZlQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B9631807D7; Sun, 21 Jul 2024 09:51:05 -0400 (EDT) Received: from pastel (unknown [45.72.245.253]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 835E712030F; Sun, 21 Jul 2024 09:51:05 -0400 (EDT) From: Stefan Monnier To: Philip Kaludercic Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected In-Reply-To: <87sew2ly1n.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 21 Jul 2024 12:39:00 +0000") Message-ID: References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> <86frsn55t3.fsf@gnu.org> <865xt0e6wc.fsf@gnu.org> <87ikx0mk4c.fsf@posteo.net> <87sew2ly1n.fsf@posteo.net> Date: Sun, 21 Jul 2024 09:51:04 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) 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.291 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 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503 Cc: mekeor@posteo.de, Eli Zaretskii , 71503@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 (---) > Another confusing behaviour that we should document is that in > > (let ((a nil)) > (funcall > (pcase-lambda (a (and (guard a) b)) > (list a b)) > 1 2)) > > I would expect that the (guard a) would use the nil binding from the > `let' form, but instead it is ignored and b is bound to 2. I am not > sure if this is related to the "destructing" point or not. It most definitely is: the `guard` controls here whether the pattern matches or not, but since it's a destructuring match `pcase` takes it for granted that the pattern does match, so the guard is ignored. What might be more confusing is the scoping, e.g.: (macroexpand '(pcase-lambda ((and (guard a) b) a) (FOO))) => #'(lambda (arg0 a) (pcase-let* (((and (guard a) b) arg0)) (FOO))) so the `a` in the guard refers to the argument that follows rather than to a surrounding `a` binding. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 04 03:58:32 2024 Received: (at 71503) by debbugs.gnu.org; 4 Aug 2024 07:58:32 +0000 Received: from localhost ([127.0.0.1]:55399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saW8O-00059z-Ag for submit@debbugs.gnu.org; Sun, 04 Aug 2024 03:58:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saW8L-00059I-FM for 71503@debbugs.gnu.org; Sun, 04 Aug 2024 03:58:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1saW7u-0003ty-Uw; Sun, 04 Aug 2024 03:58:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6Dl63JBcBQmgqGy/NAfx4/hjXJEN5IZJlwGZrzADpJM=; b=S3wbokdXcHk6 0kFcVvNRNgju3YNXsTht4qt87Cs5OCRJznWBqA27Skrujig61qnC2u/3TzajYhck8RoxfvumzG+Gt rFVRWHUDyXLDBLuT2mgCaWlkMLFujFkI/KUgBkU/lViefesnYGSp4Aw/noylj8sPjRMJbeh1BRC+G IW8Z4/BOCCxtNPWq+zDnuLF7cJbgwMqvVUGZfZqDop8z5sGBzYnIc7XfYBFNtBWVqRENVxER7zvox 94deooXdX0JY7sR2aY+6KLer9ZLqPsbEZd8SnM57rBXYj4VJtRAnxMGBuGWUG+PjiOHO3e2C8jZ6j mvE85dYrDAXU7m+bcQXmRA==; Date: Sun, 04 Aug 2024 10:58:00 +0300 Message-Id: <86r0b4sos7.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Sun, 21 Jul 2024 09:51:04 -0400) Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> <86frsn55t3.fsf@gnu.org> <865xt0e6wc.fsf@gnu.org> <87ikx0mk4c.fsf@posteo.net> <87sew2ly1n.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503 Cc: mekeor@posteo.de, philipk@posteo.net, 71503@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 (---) Ping! can we please make progress with this issue, one way or another? > From: Stefan Monnier > Cc: Eli Zaretskii , mekeor@posteo.de, 71503@debbugs.gnu.org > Date: Sun, 21 Jul 2024 09:51:04 -0400 > > > Another confusing behaviour that we should document is that in > > > > (let ((a nil)) > > (funcall > > (pcase-lambda (a (and (guard a) b)) > > (list a b)) > > 1 2)) > > > > I would expect that the (guard a) would use the nil binding from the > > `let' form, but instead it is ignored and b is bound to 2. I am not > > sure if this is related to the "destructing" point or not. > > It most definitely is: the `guard` controls here whether the pattern > matches or not, but since it's a destructuring match `pcase` takes it > for granted that the pattern does match, so the guard is ignored. > > What might be more confusing is the scoping, e.g.: > > (macroexpand '(pcase-lambda ((and (guard a) b) a) (FOO))) > => > #'(lambda (arg0 a) (pcase-let* (((and (guard a) b) arg0)) (FOO))) > > so the `a` in the guard refers to the argument that follows rather than > to a surrounding `a` binding. > > > Stefan > > From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 04 10:55:19 2024 Received: (at 71503-done) by debbugs.gnu.org; 4 Aug 2024 14:55:19 +0000 Received: from localhost ([127.0.0.1]:56953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sacdi-0002DZ-Kp for submit@debbugs.gnu.org; Sun, 04 Aug 2024 10:55:19 -0400 Received: from mout01.posteo.de ([185.67.36.65]:53101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sacdg-0002D3-4t for 71503-done@debbugs.gnu.org; Sun, 04 Aug 2024 10:55:16 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E94F7240029 for <71503-done@debbugs.gnu.org>; Sun, 4 Aug 2024 16:54:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1722783286; bh=DUCL8wTprjUOle1xqDS4hQP+GxxsS+1Y1S0sEwTAhsw=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=K4QURgv4RgCWzgV5EwXaix/s6orqFSB9umb6ybgVno6XYbbXUxPUz09yfTzWiCxCT iiPGagr3sblbJpAT8smkiY3uz0HmJhypO2ZfB5MlAausY9KDW7rTcZsnnp4y3RxlQU aQ+BlSuO1eIJiLSxPXXMPQmCfhv/bpe2zRQHUc23OD4M49YqjMTD3Z38mwT2H6pmzt IYNZSRgYFQdgEcN8yscNZfspur1te7finDL3HDnz3tlplHjb8b4uZgaQyOF43H4YIx yrUd/x5xMAsjh98QXokvbbwNoiM77eNC3UkwS2qSlfU7Wyo3Db01pD7R0MMeMMtzt7 Zq18RFJXTpclg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WcMzn2lrFz9rxN; Sun, 4 Aug 2024 16:54:45 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected In-Reply-To: <86r0b4sos7.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 04 Aug 2024 10:58:00 +0300") References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> <86frsn55t3.fsf@gnu.org> <865xt0e6wc.fsf@gnu.org> <87ikx0mk4c.fsf@posteo.net> <87sew2ly1n.fsf@posteo.net> <86r0b4sos7.fsf@gnu.org> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Sun, 04 Aug 2024 14:54:44 +0000 Message-ID: <87bk28z6bv.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503-done Cc: mekeor@posteo.de, Stefan Monnier , 71503-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 (---) Eli Zaretskii writes: > Ping! can we please make progress with this issue, one way or > another? I've pushed the change in 0756f308 that Mekeor previously acknowledged as fine. Closing. >> From: Stefan Monnier >> Cc: Eli Zaretskii , mekeor@posteo.de, 71503@debbugs.gnu.org >> Date: Sun, 21 Jul 2024 09:51:04 -0400 >> >> > Another confusing behaviour that we should document is that in >> > >> > (let ((a nil)) >> > (funcall >> > (pcase-lambda (a (and (guard a) b)) >> > (list a b)) >> > 1 2)) >> > >> > I would expect that the (guard a) would use the nil binding from the >> > `let' form, but instead it is ignored and b is bound to 2. I am not >> > sure if this is related to the "destructing" point or not. >> >> It most definitely is: the `guard` controls here whether the pattern >> matches or not, but since it's a destructuring match `pcase` takes it >> for granted that the pattern does match, so the guard is ignored. >> >> What might be more confusing is the scoping, e.g.: >> >> (macroexpand '(pcase-lambda ((and (guard a) b) a) (FOO))) >> => >> #'(lambda (arg0 a) (pcase-let* (((and (guard a) b) arg0)) (FOO))) >> >> so the `a` in the guard refers to the argument that follows rather than >> to a surrounding `a` binding. >> >> >> Stefan >> >> -- Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 04 11:08:47 2024 Received: (at 71503-done) by debbugs.gnu.org; 4 Aug 2024 15:08:47 +0000 Received: from localhost ([127.0.0.1]:56974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sacqk-0002wI-Uj for submit@debbugs.gnu.org; Sun, 04 Aug 2024 11:08:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sacqi-0002vQ-Te for 71503-done@debbugs.gnu.org; Sun, 04 Aug 2024 11:08:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sacqH-00065K-10; Sun, 04 Aug 2024 11:08:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=65NAIFXxlrQn0I9eHwCKAjRshHpCPYpX6oD78zPa9Bo=; b=aGY5OrHt1POL jwm82vUyZRlRaDO78OGQYmAYtnRiYgNQEYDECylQlcdYpjBn4u1Na5CzAfAvh9bMTrpftYDhxQVKB UyQYzra7kFY1PxX6bVj8nVQy/q5eCjy3aRuBO+O2JgXl8H7AnRKk1XiXd/5iWk1HQvRYOxmqnFOP8 Nqxwgf8yDhafxkbaCej1WS6XTop9LFh4T69k4bYpiupwOOrNAPAfWIs/n1W6ze2ev4qA9+sCPsikT 0fhPuKzSyk3kGW6fRkZN66CeF4SNO+wKD46Qj9Aa/tU2UaPrEO3Hws/SkCbiEJIa5eTMabTPAVJXj n14xvif+E5rradYxoVjzUQ==; Date: Sun, 04 Aug 2024 18:08:13 +0300 Message-Id: <86v80gqqaq.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87bk28z6bv.fsf@posteo.net> (message from Philip Kaludercic on Sun, 04 Aug 2024 14:54:44 +0000) Subject: Re: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> <86frsn55t3.fsf@gnu.org> <865xt0e6wc.fsf@gnu.org> <87ikx0mk4c.fsf@posteo.net> <87sew2ly1n.fsf@posteo.net> <86r0b4sos7.fsf@gnu.org> <87bk28z6bv.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71503-done Cc: mekeor@posteo.de, monnier@iro.umontreal.ca, 71503-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 (---) > From: Philip Kaludercic > Cc: Stefan Monnier , mekeor@posteo.de, > 71503-done@debbugs.gnu.org > Date: Sun, 04 Aug 2024 14:54:44 +0000 > > Eli Zaretskii writes: > > > Ping! can we please make progress with this issue, one way or > > another? > > I've pushed the change in 0756f308 that Mekeor previously acknowledged > as fine. Closing. Thanks! From unknown Mon Jun 16 23:51:32 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, 02 Sep 2024 11:24:05 +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