From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Newsgroups: gmane.emacs.devel Subject: Re: Regexp bytecode disassembler Date: Sun, 22 Mar 2020 15:43:03 +0100 Message-ID: <87sgi05u2w.fsf@gmail.com> References: <4201DF24-BCC4-4C08-9857-38207B7C10B4@acm.org> <83mu8bdriv.fsf@gnu.org> <68FB4EC3-3C67-4D07-8473-5FC671024515@acm.org> <834kuhecsr.fsf@gnu.org> <875zex79bx.fsf@gmail.com> <83y2rtcux2.fsf@gnu.org> <871rpl77zy.fsf@gmail.com> <83r1xkcwbk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="97687"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: mattiase@acm.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 22 15:43:15 2020 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 1jG1op-000PIO-7x for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Mar 2020 15:43:15 +0100 Original-Received: from localhost ([::1]:46828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG1oo-0002hh-8Q for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Mar 2020 10:43:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32940) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG1oK-0002Fh-62 for emacs-devel@gnu.org; Sun, 22 Mar 2020 10:42:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG1oJ-0006ry-7H for emacs-devel@gnu.org; Sun, 22 Mar 2020 10:42:44 -0400 Original-Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]:34011) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG1oH-0006qr-QP; Sun, 22 Mar 2020 10:42:41 -0400 Original-Received: by mail-lj1-x243.google.com with SMTP id s13so11673472ljm.1; Sun, 22 Mar 2020 07:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=GPABVIWpUjd/dKiI/e6sKjhjLhwMsYrUKXAgbGaAAHQ=; b=doybec0+KVPekZ0LIbpRSUXi1YHSHVpc/PUAATr+AafHHpkWp7hgH+996ni30kgIxW CpUcPBcaA7Vfz23f49ngOI87pXyJ5+EPsvai31HqdrkqYFhkFDmO0YHIQ+hl1Saz0I+q fjqeun1snycj+jxKgWbnoIrt4SW55TLomBt/9RzMDhR7gpvfAHRp3eZF+BhQWXRVORY2 w5eSiNXsVJdKL703KAH/SG5g+AG0k8Nlluf73beTZLypISDMrqYKoTn9CJTbjahk6TIU 2bPDRmWGnwzAoJrWBb9vqTRUv8id3X6TYW23xsSWhx8gr+riP5b3qs7Tu8O7jlcusiWs UDXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=GPABVIWpUjd/dKiI/e6sKjhjLhwMsYrUKXAgbGaAAHQ=; b=hPqLuEmeYkPAIapSTcavfEdpfiE4vFbxmQax/9OT/LRaoCLszgAZFq2MXuvAwvyOhY f5X1RYMa/1gYUWBHYfFRccFYUS1FC2Sxrq8EoAMHeitqMEmaJuOcHEtyTj/MiDZcS4K4 7yeQI570noT76MjGF/uwOE3H53hAXLg8lSHTjMnZB+z+8BM+xtcFpZOeRvDxXL5lwpq+ YiLKShiYszdJ4HhcSt2uRDXk43pUEfIPws/Blx2/LLoUIg+15pjJ3bLAiNrl9qKjB2Uy tgpiH6LZ2fouqEp8IRmh/Wh8RzIWP0oQFD3RHjRn8F08OIKGp9mmZwjAmlfs6V9rclkh mSDw== X-Gm-Message-State: ANhLgQ1BSKjw8o6WVqR3SVyJKa1Q6ib/bvW8QoXvIWXkbO17NPWRyhOu Yv6/Zp12MCJfW1mB26Q1E5RiLEBq X-Google-Smtp-Source: ADFU+vv46til8vnH9/3ZJuL0aq1CETEJ6b8K30WpNPPFVXkEV4fkz8fXDpnirO1adY5O5ZWxax4QAg== X-Received: by 2002:a05:651c:2042:: with SMTP id t2mr10444683ljo.188.1584888160070; Sun, 22 Mar 2020 07:42:40 -0700 (PDT) Original-Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id u15sm7018980lju.14.2020.03.22.07.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 07:42:39 -0700 (PDT) In-Reply-To: <83r1xkcwbk.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 22 Mar 2020 16:12:47 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::243 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:245670 Archived-At: On Sun, 22 Mar 2020 16:12:47 +0200 Eli Zaretskii wrote: >> It's unnecessarily verbose and most of that is just repetition, i.e. >> noise, which makes it harder to read. It _begs_ to be rewritten with >> (p)case. :-) > > In that case, it's the other way around IMO: using pcase here is like > firing cannons at birds -- it's un-economical (a.k.a. "suboptimal"). > > Please think about people who are not 100% at home with advanced > macros such as pcase: they will have a harder time understanding what > the code does. This is especially relevant to this feature, since it > is quite probable that it would have been used by someone working on > the Emacs regex code, so Lisp proficiency may not be guaranteed. That > is one reason why I asked to have the code prominently commented and > documented. I am aware of that; I intentionally put the (p) in parentheses, and I did say _some_ kind of case/switch instead of general conditional. IMHO the complexity of `pcase' is completely transparent in this case: it does what I believe anyone without any knowledge about the macro would expect it to do just looking at it (and you can easily check the expansion e.g. with M-x pp-macroexpand-last-sexp). That said, there is always `cl-case', of course, as Drew suggested. --=20 =C5=A0t=C4=9Bp=C3=A1n