From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: combining cond and let, to replace pcase. Date: Sun, 19 Nov 2023 15:59:46 +0200 Message-ID: References: <878r6u3s7f.fsf@web.de> <831qcmklys.fsf@gnu.org> <87v89x3o19.fsf@web.de> <83v89xki0p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28389"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii , Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 19 15:00:17 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 1r4iLO-00079c-IT for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Nov 2023 15:00:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4iL4-0003ah-Sr; Sun, 19 Nov 2023 08:59:54 -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 1r4iL3-0003aZ-I7 for emacs-devel@gnu.org; Sun, 19 Nov 2023 08:59:53 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4iL2-0006fM-4g; Sun, 19 Nov 2023 08:59:53 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9D3DC5C018E; Sun, 19 Nov 2023 08:59:49 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 19 Nov 2023 08:59:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1700402389; x=1700488789; bh=KdP6cMTeo5QxyfCNE/AwJ80DQGrqkckyKGB r//LkK6w=; b=dPstPLoSvOavSQs52CUkum43tJPXFUGj4Ug5oQdebioFBgCBpW6 NdQozakbfPSWvimo70fTSRU+nlcrkjSJ0u5zakBVQVcGtnSmc93QHBEhl03zWQQD E2jcsU/yPUKUIBkjpoZyXoBiz1KxT/B1Sz7KIcrSuPkbUrh7YZ4wjOQSodFaFVYm 7xYL2MROujQjFn7012bqieU7Wk1TUMIcWz1elwzoI7cYrsXHErgC6kyKN+SPeet7 nw8WbrVVbf1ewhKEfxYdevItF0SXYJTnyI4CdbZQvoPNRw2Mp4aNqda8YSPQ2K5S rbOWoYA2k0G0P6uu7qkZ8TdumJ6ou7jnPvw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1700402389; x=1700488789; bh=KdP6cMTeo5QxyfCNE/AwJ80DQGrqkckyKGB r//LkK6w=; b=U7d5aWcyiAkTL81pJ8fSvqsVhKN1inwsHBXuPwfrdW1AU+lap4B lACAN8fpJs4rOAxRagRyH0LKomvXE25K9eD+4XXZQOllz9fthkCobMRbOhHIy6zg vd7RTMHbFOpTQEQXvNgXmFlxDYUoFgkCfrCe03eLmvyXnEX2ErFA2X+zblneVpGu qlNu2txocyHQtR33csNjkxm1dbZW4vgrb5c/GcSio77cC6WPo/mE+1+3BxWUw9a9 28/adM5K5oHX8EeM+4l4tFiZ2TzpquoOt80KMqgElWs/AdxGO8CjnQ8MWF1Phkac 09GrFpnzUki97bjpCCTlYHG6HNqd7SF5ZFw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeggedgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 19 Nov 2023 08:59:48 -0500 (EST) Content-Language: en-US In-Reply-To: <83v89xki0p.fsf@gnu.org> Received-SPF: pass client-ip=66.111.4.26; envelope-from=dmitry@gutov.dev; helo=out2-smtp.messagingengine.com X-Spam_score_int: -65 X-Spam_score: -6.6 X-Spam_bar: ------ X-Spam_report: (-6.6 / 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, NICE_REPLY_A=-3.74, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-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:312976 Archived-At: On 19/11/2023 15:08, Eli Zaretskii wrote: >> Actually both and none, this is exactly the point I raised in my other >> reply - both have exactly the same complexity, and it is totally >> subjective and only habit which one you prefer. > It isn't only that. It is also that the obscure and subtle nature of > regexp strings makes it easy to make mistakes. Just look at the sheer > number of regexp mistakes uncovered in our code base by Mattias > EngdegÄrd during the last year. It isn't an accident. pcase is much better guarded against programmer mistakes because in a lot of cases typos or misunderstandings will be highlighted by the byte-compiler (potentially, with flymake directly in the buffer, which I also recommend everyone to enable). Both rx and string regexps aren't able to take advantage of such. Mattias's checker took a lot of steps toward the same functionality, but it's ultimately limited, e.g. because we don't annotate regexps any differently from strings in the code.