From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: Clarify `pcase' `rx' pattern doc Date: Sat, 07 Jul 2018 15:36:04 +0200 Message-ID: <8736wvf9rv.fsf@web.de> References: <87fu1rqr6m.fsf@web.de> <87in6gff2t.fsf@web.de> <83wouwrq3d.fsf@gnu.org> <87tvpw4cjt.fsf@web.de> <83vaacqjpl.fsf@gnu.org> <87lgb841g0.fsf@web.de> <831scxvd5a.fsf@gnu.org> <87bmbk4586.fsf@web.de> <834lhbleol.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1530970468 23262 195.159.176.226 (7 Jul 2018 13:34:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Jul 2018 13:34:28 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 07 15:34:24 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 1fbnLz-0005wT-Rz for ged-emacs-devel@m.gmane.org; Sat, 07 Jul 2018 15:34:23 +0200 Original-Received: from localhost ([::1]:33717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbnO7-0006SL-2u for ged-emacs-devel@m.gmane.org; Sat, 07 Jul 2018 09:36:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbnNk-0006Jo-HX for emacs-devel@gnu.org; Sat, 07 Jul 2018 09:36:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbnNf-00064T-Jg for emacs-devel@gnu.org; Sat, 07 Jul 2018 09:36:12 -0400 Original-Received: from mout.web.de ([217.72.192.78]:37425) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fbnNf-00063j-9K; Sat, 07 Jul 2018 09:36:07 -0400 Original-Received: from drachen.dragon ([94.216.139.22]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MVu1U-1fZaSC3V4S-00X3fr; Sat, 07 Jul 2018 15:36:04 +0200 In-Reply-To: <834lhbleol.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Jul 2018 09:53:30 +0300") X-Provags-ID: V03:K1:CmEiEWNITOk9Dz9I7Jmw+HsSR2taROytFdpg3G9TNdOLezG3R34 FMzasRsxMIi1k2jxUHYRoyyZCgq/lNe1m8I8bK92MnFVsf6mL2YX+1QU1hHYke72Q/Wbuhn QpnjYxq5i6lk1shzbb9TndTgjc2Q5rUNNGByTvnlnm3jBV2qhG8Q5OlipKfKt4ELI4ZVPBR a89zeWkoVQT9g+W0U9Kqw== X-UI-Out-Filterresults: notjunk:1;V01:K0:sBfwsIbFapI=:guhnL49aJZELVt66gY6TuV AYkA7CoYx59NvXQwnAbSyUtkoblq1Fk0oULQ0Wcjs748J1l01qKLATZInJwN5GTw670wOgBR1 BgGhVOQ1avJgYBHUlzeUcHtzIm6dbMqS4UTNxKCQOCjK09lDkBn5sU/ig6LRhGD+uosXuBGZR FQDTp50YplNXO2MblxiCp1O+6orHwKl5JvJF2Ah+wCmDYySf9xo2+vu3bPP8BkDBxt4NLRB+C ky72lT9YnGGNiGr2IlVRErB5qNRqOYcVbfrWW5jar6er/zCDBazJTuKbpkoNXoclvSyXo4cYA pIJ9dqffdZDVetE88/ahq1olLWoFVZDsTg71eteX56oG76ENBEthSvNguG7xQu6v6ag8MN3DL gQcC692Dap8xJBtOfEesGFNLMsKp4vZBm9qQTgDa/Q+6jqMQw4BpxXOUgZEwIHjJqa+Xd1XIr OdWp+3cKh1AxxIpKp6kjjbiwR4/RYuQKJCjZeQWcqP3kjD0S+faTwp17wAoD7zSCHUA2D+Aao qPEeHC7zKqZr7BGvd76K924pVx9dktSxwzcUUWC+9GQsGAc2ODIlW/J9CHdo6KZsBpQrD8xq/ p+d9Sji41EUylw4g9Y0BuP74V8Bfl2BbloKyNGi30HQCsfsHQx8F0NFVlWkHD0qb2Z/yXIXGe p7tRvzGFtvw8QT+jYmxkYqrsmqlfcgkhPBBz+TuDY0kmSwvaZG28cXMnyRRLzc9LJ7CiXlRzV GmUbehIZPuBrtaHbHuRF/ZEDvEGFOQN3bxxO6gWzNpibYr0jDxfw05YdvzNF/PwTGmU9CJPA X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.78 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:227055 Archived-At: Eli Zaretskii writes: > > > + [...] If the target is not a string, signal an error. > > > > We want to change that, so I think you can drop that sentence. > > Shouldn't it be dropped when that change is committed? Then we would break documented behavior then. What would be the gain? > > But can we remove the sentence saying "Multiple occurrences of the > > same VAR refer to the same submatch."? It's completely redundant > > IMHO. > > Is it redundant even when VAR is not a submatch number, but a symbol? I think so. A symbol VAR references the explicit binding created with (let VAR ...), i.e. a submatch, just like in the number case. > Btw, in this part: > > > + (let VAR SEXP...) creates a new explicitly numbered submatch > > + that matches regular expressions SEXP, and > > + binds the match to VAR. > > Does "explicitly numbered" mean that VAR must be a number? If it can > be something else, perhaps "explicitly named" is better? AFAIK, in `let' VAR must be a symbol, but it seems the submatch is also numbered as side effect, e.g. (pcase "Hala" ((rx "H" (let x "a") (regex ".*") (backref 1)) x)) ==> "a" In `backref' the argument can be a number or a symbol VAR. That's why I would prefer a different argument name in the docstring, "REF" maybe. I had done that in my suggested patch. Michael.