From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#50136: 28.0.50; A problem with rx-let expansion Date: Fri, 20 Aug 2021 15:59:44 +0200 Message-ID: <878s0wcj3j.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24166"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Stefan Monnier To: 50136@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 20 16:01:43 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1mH55b-0006BU-4b for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Aug 2021 16:01:43 +0200 Original-Received: from localhost ([::1]:59822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mH55a-0001O2-2j for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Aug 2021 10:01:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH54x-0001NV-JI for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2021 10:01:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51876) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mH54w-0004SB-62 for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2021 10:01:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mH54w-0005pR-4Z for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2021 10:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Aug 2021 14:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50136 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162946801219467 (code B ref -1); Fri, 20 Aug 2021 14:01:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Aug 2021 14:00:12 +0000 Original-Received: from localhost ([127.0.0.1]:35183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mH548-00053W-3f for submit@debbugs.gnu.org; Fri, 20 Aug 2021 10:00:12 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mH547-00052J-4V for submit@debbugs.gnu.org; Fri, 20 Aug 2021 10:00:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH545-0001FC-OQ for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2021 10:00:10 -0400 Original-Received: from mout.web.de ([212.227.17.12]:54939) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH541-0003WJ-Cv for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2021 10:00:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1629467986; bh=IkX0e0CunhPzHG2FHfOHCKwqBCA5VOLLhItbn1MZBrA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=Z4cbqOL+gerbq289acTXv9Q2RvBLaRvhCf7fdJjqgyvmQcZTf9KPe5KvUbaO22oKL sjmqeVZmn3Nl5+VhcUF356VgV9QznVhgz0WatwqiIRydR/rUSS9rS6dHpY8KmRBxVI emYd3GJHBCneTtwE9Kvn98T4/YLeLSHN1vfaFZ84= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([88.66.201.45]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LvBV8-1nG1gG04mo-010IFX; Fri, 20 Aug 2021 15:59:46 +0200 X-Provags-ID: V03:K1:O3Brt43SWLQ4WWta0JhVCiBCWr69IVrneVMeXPv/7e0WsoyniAx ilBJhGBOCYl4rq18km8M0ZxxC9dLhKlZIf5lOmKaC0TEsM2Mc+vCLPKksHnl4004y86ICwO o0qa+R82H1Y1mfJrefzI4Qjc0gAQ6Aovs8YZNcLd/FQfhxTXpgD7UUBERZQtvuWYmDOq++S +4EuAclzZNLfwrb1V517Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:2dFCqK3e2Ik=:jFrfeb6v8mk+ySA4EFlr/u djNmRGTAhCqf7BBrfECZk5PK30kAV2W9FVMoCiXILwvuzw5Ez5CLtBg9ElsyRl5d1GKtJ4Tiu 0vPRH0fnStolI8yCxwarPPpX9j/ZzCv6ldd+1SxWDm6qyEpPn/ZUvMlGTIw0F/yKHk+pZ/y2m 3hHA/+Qf5hrxaN9FGGi+8SirB3JeuJCo8c1JkjnNIpf1LYdvwuZKWI7GQb9UTWBUSBPY01ZHu Eo1Ura6gs2Q4RiVyDkHNGCB6Y9QAiYafe/bWLXC5VOVOucvHoWoSv1eJOYoagwINlkHWhK//u E1uAkK6HPnWE775z8DXRGlxtNZBugRwx6XndVhJu/rlXPiUIzi0ChIO/iVfU8/Xcol/k/Ux7w 06P0Q5tNk0kc/DvtFfTMnWt7pSkyRMG5er7nsum3gjp++IjRg0NfGUvjiyWt5xPu46L+7hucu k1pTRomkZr7rSqnaQ3XL+DEqdOqL5oN3SUK8yZNX6dnR/CuypB4hxcd4B7p8nd7FFeZLo8ru+ PgWK20MAGMb0nIZywX0CzgJQRt8km89eKjAPq8Q+OjjMkvS3191k8TDv9dgivG52fNyJnMglu 8Rm5GEmhn++N41f7J5AVrYxzqb+pHYgHCO0egABqo0DNzCiUNy8VxYoy9cP70OnV0tsAeFO7K Rs0uqMQTFUG5zo/8V48edg2kEjJH7PKT+YagOIxovnQCX60yyBaX9X1fQLcZMI2Z8mzLUUTWh xO0suRwzmKprWHDGLu7pnxPnY0MxT607atnLeWYqDFpmtmhf7ibvpEkQ6WESj/ueQyrKZgP+ Received-SPF: pass client-ip=212.227.17.12; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212272 Archived-At: Hello, I'm referring to this paragraph in rx.el: ;; FIXME: Consider adding extensions in Lisp macro style, where ;; arguments are passed unevaluated to code that returns the rx form ;; to use. ;; [...] ;; While this would permit more powerful extensions, it's unclear just ;; how often they would be used in practice. Let's wait until there is ;; demand for it. Ok - here is! I would find that approach much more natural than the current one. Look: Already the first `rx-let' pseudo macro I tried hit a problem (bug) with the current approach: #+begin_src emacs-lisp (rx-let ((scatter (string) (regex (mapconcat #'string (string-to-list string) ".*")))) (rx (scatter "abc"))) => useless error message #+end_src while the following version (the only difference is the argument name) works as expected: #+begin_src emacs-lisp (rx-let ((scatter (s) (regex (mapconcat #'string (string-to-list s) ".*")))) (rx (scatter "abc"))) ==> "a.*b.*c" #+end_src Seems the function form #'string gets replaced and ends as #'"abc" in the first version because the function name accidentally collides with the argument name. Personally I would be more happy with a thing called `rx-macrolet' than with an extended `rx-let' to support this additional macro-like kind of syntax. TIA, Michael.