From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Clarify `pcase' `rx' pattern doc Date: Thu, 21 Jun 2018 17:48:22 +0300 Message-ID: <83vaacqjpl.fsf@gnu.org> References: <87fu1rqr6m.fsf@web.de> <87in6gff2t.fsf@web.de> <83wouwrq3d.fsf@gnu.org> <87tvpw4cjt.fsf@web.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1529592390 29914 195.159.176.226 (21 Jun 2018 14:46:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 21 Jun 2018 14:46:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 21 16:46:26 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fW0qw-0007fp-8m for ged-emacs-devel@m.gmane.org; Thu, 21 Jun 2018 16:46:26 +0200 Original-Received: from localhost ([::1]:55880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW0t3-0004n7-8W for ged-emacs-devel@m.gmane.org; Thu, 21 Jun 2018 10:48:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW0st-0004mt-Da for emacs-devel@gnu.org; Thu, 21 Jun 2018 10:48:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW0so-0001U0-EQ for emacs-devel@gnu.org; Thu, 21 Jun 2018 10:48:27 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW0so-0001Tr-AV; Thu, 21 Jun 2018 10:48:22 -0400 Original-Received: from [176.228.60.248] (port=1485 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fW0si-00087h-DD; Thu, 21 Jun 2018 10:48:18 -0400 In-reply-to: <87tvpw4cjt.fsf@web.de> (message from Michael Heerdegen on Thu, 21 Jun 2018 13:13:58 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226569 Archived-At: > From: Michael Heerdegen > Cc: emacs-devel@gnu.org > Date: Thu, 21 Jun 2018 13:13:58 +0200 > > Eli Zaretskii writes: > > > > (pcase-defmacro rx (&rest regexps) > > > - "Build a `pcase' pattern matching `rx' regexps. > > > -The REGEXPS are interpreted as by `rx'. The pattern matches if > > > -the regular expression so constructed matches EXPVAL, as if > > > -by `string-match'. > > > + "Build a `pcase' pattern matching with `rx' REGEXPS. > > > > I don't like calling this "regexp". Elsewhere in rx documentation we > > say either "regexps in sexp form" or just "form". Using "regexp" > > might confuse the reader to think these are the "normal" regexp > > strings. > > But hey, ehm - I didn't change this, I just upcased the argument name. That's true, but your goal was to improve the existing doc string, right? I'm saying that using "REGEXP" doesn't improve it. > > > - (let VAR FORM...) creates a new explicitly numbered submatch > > > - that matches FORM and binds the match to > > > - VAR. > > > - (backref VAR) creates a backreference to the submatch > > > - introduced by a previous (let VAR ...) > > > - construct. > > > + (let VAR REGEXPS...) creates a new explicitly numbered > > > + submatch that matches the `rx' REGEXPS > > > + and binds the match to VAR. > > > > IMO, this change is for the worse: the original clearly indicated that > > FORM is the rx-style regexp, whereas the new text blurs this > > indication. > > And here I just used the same name for the `let' argument, since it's of > exactly the same type as the argument of the `rx' pattern. > > Even the normal `rx' macro (not the pcase macro) names its &rest > argument "REGEXPS" - so I think now what I suggested was just > consistent. Of cause could we change all occurrences of "REGEXPS" to > "FORMS" or something better, but I think this is not in the scope of my > suggested commit. Could you please elaborate on what you didn't like or found confusing in the original text, and why? Then perhaps I could suggest how to modify the text to satisfy us both. OK?