From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: "Raw" string literals for elisp Date: Wed, 8 Sep 2021 17:41:47 +0200 Message-ID: References: <4209edd83cfee7c84b2d75ebfcd38784fa21b23c.camel@crossproduct.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24579"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers , Anna Glasgall , Stefan Monnier To: =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 08 17:44:29 2021 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 1mNzkR-00067V-6P for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Sep 2021 17:44:27 +0200 Original-Received: from localhost ([::1]:50920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNzkQ-0006CN-3u for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Sep 2021 11:44:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNzi8-0002Iw-Gd for emacs-devel@gnu.org; Wed, 08 Sep 2021 11:42:04 -0400 Original-Received: from mail-pl1-f173.google.com ([209.85.214.173]:37418) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNzi4-0000Pm-Pu for emacs-devel@gnu.org; Wed, 08 Sep 2021 11:42:03 -0400 Original-Received: by mail-pl1-f173.google.com with SMTP id q3so1567600plx.4 for ; Wed, 08 Sep 2021 08:42:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=kelLEgIVrBS/10N4QB3+SM8K9tEuZq2jWGkshVzvHes=; b=bja6HUGM1sNcRsvvbsdLVZwrlDfY69Khykwm3p/zJ5oBkOurLwSgp71Tk56u8TJ9zo dhwFu1zWyGqI1p1K21KydnJDFHDxSffcd2KUNl4osDkBmpaIGGhjkce+IO8UsJjYVcX9 QMEI0R0kBtc7DQtk7zel1Q+VFoYvgWL1GUs3TvugI7crq1fWxYKSoJ9jY4cbHJw/zQ7A VNa2B7Y4FoPTCP21580ayvK9tZ6TZ/MLVYFqp8nz38E0zD5h4iHk3X7WVjJ1lcDVV3Ci UgnXwwFSPhw2fyvfED9FnWsyI0/Eo1CdETx0rqaugJ/kq87wPaWQBVWLYkxos8sVQBYN n8Kg== X-Gm-Message-State: AOAM5303usLNfjyyKXXdIkeG5Co7A33ROlMpcvv1L3WD75Ocx3fcd45x aA+2BYiPP7y7E4eXFxDY6Z7wQ9zQJJpPLo3OJkc= X-Google-Smtp-Source: ABdhPJzKUDbfRKYyqtAsW0y1gX1VW19Koc2KhTqaXioVtJSg3dsJXH78gY4c5s8W+fnmU791/5+45pVVZDAAt0CiQoM= X-Received: by 2002:a17:90a:7c42:: with SMTP id e2mr4807908pjl.132.1631115719193; Wed, 08 Sep 2021 08:41:59 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=209.85.214.173; envelope-from=stefankangas@gmail.com; helo=mail-pl1-f173.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:274361 Archived-At: Mattias Engdeg=C3=A5rd writes: > Elisp actually has a much better regexp syntax than most other languages: > > > "\\(\\\\\\\\\\)\\(?:\\(\\\\\\\\\\)\\|\\((\\(?:\\?[0-9]*:\\)?\\|[|)]\\)\= \)" > > Today that would be written > > (rx (group "\\\\") > (or (group "\\\\") > (group > (or (seq "(" > (? "?" (* digit) ":")) > (in ")|"))))) > > which is much more readable and maintainable and less error-prone than wh= at you would get with a new string syntax. That's true. I hope that we can preload rx and use it more. But ELisp is also intended for end-users that want to hack together some quick command. They may be completely uninterested in spending even a minimum of time to learn rx, and prefer instead to use the more standard form they already know so they can just get their job done. I'm not even sure that rx is the unequivocal first choice among hardcore ELisp programmers.