From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Thu, 16 Nov 2023 21:19:48 +0200 Message-ID: <83fs15pktn.fsf@gnu.org> References: <87fs169mjj.fsf@posteo.net> <877cmhlhjp.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34876"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 16 20:20:42 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 1r3hus-0008sy-HN for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Nov 2023 20:20:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3huA-0005cJ-CR; Thu, 16 Nov 2023 14:19:58 -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 1r3hu7-0005c1-Rm for emacs-devel@gnu.org; Thu, 16 Nov 2023 14:19:56 -0500 Original-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 1r3hu6-0007nP-Jz; Thu, 16 Nov 2023 14:19:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=K+nGE0zDfy4WifCUFX1y4dP2TGzFCDXL/+Sopawj5xA=; b=L3sUsXcrHOJhPZHITqtf TOFXzdmFoxqW3mS5fuo0ISQucV1B6M33yhH1AcZVrqKEhTH0w6iSkKdOKRazFumVI9SXXb17/t7oQ KM+n2gJw09EOXUqUUxCxkc4kicxjx7tYqumJlvDKLDx6LtX7ngBDSlL/u+QD8RArnU8Yug7Mqeotw BzvrwGOWWO94pzAxQ8yRBnTP+yE0TH8JAZ32CdNK0kqFWgxv6wPoKa2uAMTQ7fodvCL+jKtQPWPig RU0xluWUxaA09lg2l+cirqLGYnU3v8zJCP2R7MmcaWANXcyGiSJmsuQgmrhlxziVRk2f+hgTumOE6 LInuZEExCiVunA==; In-Reply-To: <877cmhlhjp.fsf@web.de> (message from Michael Heerdegen on Thu, 16 Nov 2023 18:44:10 +0100) 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:312832 Archived-At: > From: Michael Heerdegen > Date: Thu, 16 Nov 2023 18:44:10 +0100 > > "T.V Raman" writes: > > > I recently tried to understand some of the completion code; -- > > specifically, completion-at-point, and immediately hit the pcase wall > > and gave up --- my lack of understanding of pcase made that code in > > Emacs Core read like line-noise. > > But that pcase form is only performing trivial destructuring. If it does, then the node "Destructuring with pcase Patterns" Needs Work™, because if you try to compare this fragment from completion-at-point: (pcase res (`(,_ . ,(and (pred functionp) f)) (funcall f)) (`(,hookfun . (,start ,end ,collection . ,plist)) with the example in the manual that explains destructuring, viz.: (pcase my-list (`(add ,x ,y) (message "Contains %S and %S" x y))) you will, I hope, see the difficulty of a newcomer to 'pcase' in understanding how the code in completion-at-point is "only destructuring". IOW, if this code is "just destructuring", we don't do a good-enough job of explaining that in the manual.