From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Regexp bytecode disassembler Date: Sat, 21 Mar 2020 22:30:49 +0200 Message-ID: <83y2rtcux2.fsf@gnu.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="14482"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mattiase@acm.org, emacs-devel@gnu.org To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 21 21:31:36 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 1jFkmO-0003in-Mu for ged-emacs-devel@m.gmane-mx.org; Sat, 21 Mar 2020 21:31:36 +0100 Original-Received: from localhost ([::1]:40628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFkmN-0006a6-Ml for ged-emacs-devel@m.gmane-mx.org; Sat, 21 Mar 2020 16:31:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48563) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFklg-0005h5-7P for emacs-devel@gnu.org; Sat, 21 Mar 2020 16:30:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jFklg-00066K-3D; Sat, 21 Mar 2020 16:30:52 -0400 Original-Received: from [176.228.60.248] (port=2745 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jFklf-0007ha-8R; Sat, 21 Mar 2020 16:30:51 -0400 In-Reply-To: <875zex79bx.fsf@gmail.com> (message from =?utf-8?B?xaB0xJtw?= =?utf-8?B?w6FuIE7Em21lYw==?= on Sat, 21 Mar 2020 21:16:02 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:245642 Archived-At: > From: Štěpán Němec > Cc: Mattias Engdegård , > emacs-devel@gnu.org > Date: Sat, 21 Mar 2020 21:16:02 +0100 > > Do you mean you would prefer to use `cond' and rewrite all those clauses > to something like the following? > > (cond > ((eql opcode 0) (cons 'no-op 1)) > ((eql opcode 1) (cons 'succeed 1)) Yes. > Maybe readability is much more subjective than I thought, but I find the > latter very suboptimal, to say the least. Why "suboptimal"? > Also, isn't "just selecting from a list of fixed values" precisely the > reason to use some sort of case/switch instead of the general `cond'? 'cond' _is_ a case/switch construct. > Certainly `pcase' can also be useful in more complicated use cases, but > it will expand to the cond form anyway, so I also don't see any > performance concerns. I said nothing about the performance.