From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: michael-franzese@gmx.com Newsgroups: gmane.emacs.help Subject: Re: pcase without code duplication Date: Fri, 23 Apr 2021 05:45:43 +0200 Message-ID: References: <877dktel9m.fsf@telefonica.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15013"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: =?UTF-8?Q?=C3=93scar_Fuentes?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 23 05:46:10 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZmle-0003oh-EX for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 23 Apr 2021 05:46:10 +0200 Original-Received: from localhost ([::1]:40442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZmld-0001vD-Dq for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 22 Apr 2021 23:46:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZmlJ-0001v7-4c for help-gnu-emacs@gnu.org; Thu, 22 Apr 2021 23:45:49 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:43697) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZmlG-00057F-4S for help-gnu-emacs@gnu.org; Thu, 22 Apr 2021 23:45:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1619149543; bh=97oN+jrEDloB6HHNjwE3SELgVgOPTLSS8+DroSdsZmY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=bN0HbxPm6d58Pmt2G4rTJP7wYiU/6BkZJ+yhjd55sZ1jntEVmxxsnjLsEam94UCKa 3EHJkALZXVXkz4QzRS8CVgwLila6r0oNaVda6/9sf6GmkiAK/kOKzFZSTB+m0thTUF IyGXylwtyGZDfoMy7XeE+ahl8zmfayyuza2Zzdqk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs03.server.lan [172.19.170.169]) (via HTTP); Fri, 23 Apr 2021 05:45:43 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <877dktel9m.fsf@telefonica.net> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:ysX4kpXouFv1fvzSmo9s5BEo16OiSSL0HBsKTSdTWefZ/lCd3dOLMrr4TY2jUpXAeouK5 GT8dBD1aEuT4C/3GTIaBaQj6GKy03lWg0BrTV6CsHK6tbh7eb27n25pveoKAqYhSFyrQBuxdmq8l ZGVdIdPTHAPuXqET5+MOEYXhWtanmxpcCWi8++xa65P4LfoB0xx6AsAOesFGrjd2VVwnF20ZHT/Z RZ9XDGHYlUba/oJdg7SLYU6UuZlAJwiVpfig83uUjup/nC6t5cJZMqw9DtjUJs9pPUd7wOW3E99y YA= X-UI-Out-Filterresults: notjunk:1;V03:K0:Ygm8P+f/D6E=:0XFGND/GJc6jim5n09siXu A/rk0LZksQm5TIcpeh0e5EMY4bWTRxtN/44+biKB8YBbuvyWhNc/7vYkXlbdeJAoZeaX7cJbN gWcZkcBTp+P1y/VzkWqEqspANPir2mGoW1KLgre7lI92I3YLM9itz/78v6AHVUu6VBS/ARN+F 9RdCiShEd3uT/yW5hOzpS90AnxCy4oGFWWsKRF3Eg4v1n4yVxZztkwydOD9uyKrx+72+L5n4U 8SOHts3CsQgw3P8hzaXaIp+PkgaaoydP2wJH4+sXu3vqvGf9EBZ2ubwoPop1XH85v1OTHkW8d /GgezjUtvQwhd7+vb10Z8rGg7ndmzbsMOFEFZze62xCJjBCAeTi6IKt8YfbkZQrGZr7ah8eFn LXYrGRXz4QXpCQGM7PUy3NQss+AUPEG6ztIlUKR3NavHDriatxEA6E212ggDbpYSWgz6hwfn/ VQvegnFPDdtMRzlDBs/WDxuy8oM1siczX/dBg9ZKQzxJOFrY2AwNGumRyeHqX0ErXraYMiTig m0n3bL/pJAm5L2SLL9fENYqkvpL/TQCHekWt4YL4l0hYF7b9oGJ7vXp0AuFG3TO5NTFA9vQ0B W3ZKKOdFuk6bS2MPaDBj5TO7HVO6+tRonmWvSsNKaPsuHQQcWDgAyY1nlitceMVTPzTIZrwdL /phrmzGyAH87fCDoLNq/hHhkgi87iSEKQbBr1A5v/BtxiAf833fl8MKH6P2QkTBu1PIXh3cxd b/YniFjXg/OR6HJOHCzHgcwG0uNQFcbDET0jGwrBDdxpBRWHU1AQNepZHdCj6mBKDueYVf3q Received-SPF: pass client-ip=212.227.15.18; envelope-from=michael-franzese@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:129124 Archived-At: Can one also use nil as option in pcase=2E What possibilities exist for (_ ? e=2Eg=2E (nil ((or 0 nil) ((or _ nil) =20 Regards Michael > Sent: Friday, April 23, 2021 at 3:24 PM > From: "=C3=93scar Fuentes" > To: help-gnu-emacs@gnu=2Eorg > Subject: Re: pcase without code duplication > > michael-franzese@gmx=2Ecom writes: >=20 > > I am using pcase, but am wondering whether I can have pcase > > for 0 and 2 do the same things without adding a separate pcase > > (0 and duplicating the statements=2E > > > > (pcase orthogr-region > > (0 =2E=2E=2E ) ; same operations as pcase 2 > > (1 =2E=2E=2E ) > > (2 =2E=2E=2E ) ; operations > > (_ =2E=2E=2E ) ) >=20 > (let ((xx 2)) > (pcase xx > (1 (message "one")) > ((or 0 2) (message "zero or two")) > (_ (message "something else")))) >=20 >=20 >