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 18:16:58 +0100 Message-ID: <878sjs5myd.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> <87sgi05u2w.fsf@gmail.com> <83imiwcorq.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="28539"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.29.3 (https://notmuchmail.org) Emacs/28.0.50 (x86_64-pc-linux-gnu) 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 18:18:05 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 1jG4Ef-0007Lh-5u for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Mar 2020 18:18:05 +0100 Original-Received: from localhost ([::1]:48388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG4Ee-0005ul-74 for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Mar 2020 13:18:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50527) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG4DI-0004rf-D3 for emacs-devel@gnu.org; Sun, 22 Mar 2020 13:16:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG4DH-0003pe-61 for emacs-devel@gnu.org; Sun, 22 Mar 2020 13:16:40 -0400 Original-Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]:42093) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG4DF-0003oP-EK; Sun, 22 Mar 2020 13:16:37 -0400 Original-Received: by mail-lf1-x12d.google.com with SMTP id t21so8341447lfe.9; Sun, 22 Mar 2020 10:16:36 -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=A1S4ak66sHOBIHAPpNKEfGQGnc5OtBX3EcOE7OYcQwA=; b=NwXauAXcVsRoyxqtg/GyfR6njJMrZcGV2ia5jq3XatE1ij5gasoTXqYk/GyfUW7OtD +5cH7nTgFnHDEPg/pp8eYTzHqJjFZQ/FYNvTcuxGXKak9u37qyHYdYQp8YQ0Ktdjek62 Fna1HbXFFrXQdZWhJttQK/3qJGCL2sl3LPwbHUFWQpcH2qPQbRX8sh+9XaS1Bk4ffAE0 uFJDGNLF0JYwLyras3NQxTcEPuo/k+Ss+hkiPeC5dcpF9UFGe3oS3c22blDHZ07BoJj0 1Qs+evMagz+bEvHx0p8xr2vzHlWQkct68xZli0KxLmja7udlTPscrudeCy8AqwYAIw95 bf8A== 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=A1S4ak66sHOBIHAPpNKEfGQGnc5OtBX3EcOE7OYcQwA=; b=KhBSpSjpC2xX/g+GaXENNA8Nydqk44PVXaMWfnR2lgEk3WbKsGgSVPCk05BlVskMPI SBTV8jnhUzu/Xwmb4BnxK0oQxtPH1oXLkDYr7md0DxRwUILmHOLcGXSDKdDdL2vwlD7q AhjYJTrpgc2kpT0r6WkQEQqRTmdjjFMdHSaTAIbiRJYRN4lpJ9uMJ3WZyuvKHwJvrIhb ybE7qy0j8ygyr3oMr44pwuyy/ug9+joQyR6oK5R4mCABZpS9cwFF0TJx9a7uK+lfT651 ukPadWM/rXAxkP4hcMTtBXXNGB/Y8h34b4tDYw4+gg9cU398hHOg/hA3HJwK40bsbjqy dK/Q== X-Gm-Message-State: ANhLgQ0fItnTvjumy1rlQzWHL6F2tZEm+p9XGc8bhcvy/QrZkIsQXDab KpJJOdn7nDSp2YE9d/yt2EpZgbYP X-Google-Smtp-Source: ADFU+vv+DJ0nM8qKZlubVDVMnRY0Ropsa8UXGa+ic2DFTrYaPhWI+ninN+zzljRFLaSwMki48rJlOQ== X-Received: by 2002:a05:6512:4c2:: with SMTP id w2mr10647687lfq.136.1584897394694; Sun, 22 Mar 2020 10:16:34 -0700 (PDT) Original-Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id 203sm7318686ljf.65.2020.03.22.10.16.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2020 10:16:34 -0700 (PDT) In-Reply-To: <83imiwcorq.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::12d 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:245681 Archived-At: On Sun, 22 Mar 2020 18:55:53 +0200 Eli Zaretskii wrote: >> From: =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec >> Cc: mattiase@acm.org, emacs-devel@gnu.org >> Date: Sun, 22 Mar 2020 15:43:03 +0100 >>=20 >> IMHO the complexity of `pcase' is completely transparent in this case: > > I disagree. And please also consider the easiness (or lack thereof) > of changing the code, not just reading it. pcase is far from being > simple, its syntax is tricky to understand fully. it's no accident > that it took us 2-3 iterations and many discussions to converge on > what is now its documentation. Just the volume of that documentation > should tell you how NOT transparent is its complexity. Changing code that _uses_ pcase doesn't involve changing code that implements pcase, unless I'm missing something. Given that using pcase here makes the code in question shorter (and for most of those who commented apparently also more readable) compared to the cond version, doesn't that _add_ to the easiness of changing it? >> you can easily check the expansion e.g. with M-x >> pp-macroexpand-last-sexp > > So you are saying that reading code should be accompanied by expanding > the macros it uses? Certainly not. I already said that I believe the code was perfectly understandable even for people knowing nothing about pcase (at least in this case). The macroexpand check suggestion was addressing the "economy" or avian warfare concerns (it expands to the simple cond form), or those who want to check if the intuition matches reality. In any case, you seem to still focus on the "why _pcase_" issue, which I thought was really a minor point here, and was never what I argued for specifically, instead of the "why _some_ case/switch rather than cond". --=20 =C5=A0t=C4=9Bp=C3=A1n